back interdiff of round #1 and #0

feat: mutuals pill/button from catsky.social #4

closed
opened by vielle.dev targeting main
files
bskyweb
src
components
screens
Profile
Header
REVERTED
bskyweb/cmd/bskyweb/server.go
···
e.GET("/robots.txt", echo.WrapHandler(staticHandler))
}
-
// pwa files
-
e.GET("/manifest.json", echo.WrapHandler(staticHandler))
-
e.GET("/pwa-512.png", echo.WrapHandler(staticHandler))
-
e.GET("/pwa-192.png", echo.WrapHandler(staticHandler))
-
e.GET("/iframe/youtube.html", echo.WrapHandler(staticHandler))
e.GET("/static/*", echo.WrapHandler(http.StripPrefix("/static/", staticHandler)), func(next echo.HandlerFunc) echo.HandlerFunc {
return func(c echo.Context) error {
···
e.GET("/robots.txt", echo.WrapHandler(staticHandler))
}
e.GET("/iframe/youtube.html", echo.WrapHandler(staticHandler))
e.GET("/static/*", echo.WrapHandler(http.StripPrefix("/static/", staticHandler)), func(next echo.HandlerFunc) echo.HandlerFunc {
return func(c echo.Context) error {
REVERTED
bskyweb/static/manifest.json
REVERTED
bskyweb/static/pwa-192.png
REVERTED
bskyweb/static/pwa-512.png
REVERTED
bskyweb/templates/base.html
···
<link rel="preload" as="font" type="font/woff2" href="{{ staticCDNHost }}/static/media/InterVariable.c504db5c06caaf7cdfba.woff2" crossorigin>
-
<link rel="manifest" href="/manifest.json" />
-
<style>
/**
* Minimum styles required to render splash.
···
<link rel="preload" as="font" type="font/woff2" href="{{ staticCDNHost }}/static/media/InterVariable.c504db5c06caaf7cdfba.woff2" crossorigin>
<style>
/**
* Minimum styles required to render splash.
NEW
src/components/Pills.tsx
···
</View>
)
}
···
</View>
)
}
+
+
export function Mutuals({size = 'sm'}: CommonProps) {
+
const t = useTheme()
+
+
const variantStyles = React.useMemo(() => {
+
switch (size) {
+
case 'sm':
+
case 'lg':
+
default:
+
return [
+
{
+
paddingHorizontal: 6,
+
paddingVertical: 3,
+
borderRadius: 4,
+
},
+
]
+
}
+
}, [size])
+
+
return (
+
<View style={[variantStyles, a.justify_center, t.atoms.bg_contrast_25]}>
+
<Text style={[a.text_xs, a.leading_tight]}>
+
<Trans>Mutuals</Trans>
+
</Text>
+
</View>
+
)
+
}
NEW
src/components/ProfileCard.tsx
···
const moderation = moderateProfile(profile, moderationOpts)
const modui = moderation.ui('profileList')
const followedBy = profile.viewer?.followedBy
if (!followedBy && !modui.inform && !modui.alert) {
return null
···
return (
<Pills.Row style={[a.pt_xs]}>
-
{followedBy && <Pills.FollowsYou />}
{modui.alerts.map(alert => (
<Pills.Label key={getModerationCauseKey(alert)} cause={alert} />
))}
···
const moderation = moderateProfile(profile, moderationOpts)
const modui = moderation.ui('profileList')
const followedBy = profile.viewer?.followedBy
+
const following = profile.viewer?.following
if (!followedBy && !modui.inform && !modui.alert) {
return null
···
return (
<Pills.Row style={[a.pt_xs]}>
+
{followedBy && (following ? <Pills.Mutuals /> : <Pills.FollowsYou />)}
{modui.alerts.map(alert => (
<Pills.Label key={getModerationCauseKey(alert)} cause={alert} />
))}
NEW
src/screens/Profile/Header/Handle.tsx
···
{profile.viewer?.followedBy && !blockHide ? (
<View style={[t.atoms.bg_contrast_25, a.rounded_xs, a.px_sm, a.py_xs]}>
<Text style={[t.atoms.text, a.text_sm]}>
-
<Trans>Follows you</Trans>
</Text>
</View>
) : undefined}
···
{profile.viewer?.followedBy && !blockHide ? (
<View style={[t.atoms.bg_contrast_25, a.rounded_xs, a.px_sm, a.py_xs]}>
<Text style={[t.atoms.text, a.text_sm]}>
+
<Trans>
+
{profile.viewer?.following ? 'Mutuals' : 'Follows you'}
+
</Trans>
</Text>
</View>
) : undefined}