Change many border widths from 1
to hairlineWidth
(#4294)
* feed items * update some more * moar * profile card * composer and notifications * settings screen * remove border from first item in feeds * remove border from first item in feeds * more removal of top border * fix flatlist rendering * oops * scroll to top fab * a.border * centeredview/list * placeholder * web sidebar * search posts * feeds list * user lists * list header * account list width 1 * hide top border feedgens * same for lists * fix tab bar web desktop * wait... * show the border on desktop web * fix lists * fix lists * round
This commit is contained in:
parent
8569e2e389
commit
89c9fd3be1
33 changed files with 227 additions and 144 deletions
|
@ -25,6 +25,7 @@ import * as Prompt from '#/components/Prompt'
|
|||
import {RichText} from '#/components/RichText'
|
||||
import {Text} from '../util/text/Text'
|
||||
import {UserAvatar} from '../util/UserAvatar'
|
||||
import hairlineWidth = StyleSheet.hairlineWidth
|
||||
|
||||
export function FeedSourceCard({
|
||||
feedUri,
|
||||
|
@ -34,6 +35,7 @@ export function FeedSourceCard({
|
|||
showLikes = false,
|
||||
pinOnSave = false,
|
||||
showMinimalPlaceholder,
|
||||
hideTopBorder,
|
||||
}: {
|
||||
feedUri: string
|
||||
style?: StyleProp<ViewStyle>
|
||||
|
@ -42,6 +44,7 @@ export function FeedSourceCard({
|
|||
showLikes?: boolean
|
||||
pinOnSave?: boolean
|
||||
showMinimalPlaceholder?: boolean
|
||||
hideTopBorder?: boolean
|
||||
}) {
|
||||
const {data: preferences} = usePreferencesQuery()
|
||||
const {data: feed} = useFeedSourceInfoQuery({uri: feedUri})
|
||||
|
@ -57,6 +60,7 @@ export function FeedSourceCard({
|
|||
showLikes={showLikes}
|
||||
pinOnSave={pinOnSave}
|
||||
showMinimalPlaceholder={showMinimalPlaceholder}
|
||||
hideTopBorder={hideTopBorder}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
@ -71,6 +75,7 @@ export function FeedSourceCardLoaded({
|
|||
showLikes = false,
|
||||
pinOnSave = false,
|
||||
showMinimalPlaceholder,
|
||||
hideTopBorder,
|
||||
}: {
|
||||
feedUri: string
|
||||
feed?: FeedSourceInfo
|
||||
|
@ -81,6 +86,7 @@ export function FeedSourceCardLoaded({
|
|||
showLikes?: boolean
|
||||
pinOnSave?: boolean
|
||||
showMinimalPlaceholder?: boolean
|
||||
hideTopBorder?: boolean
|
||||
}) {
|
||||
const t = useTheme()
|
||||
const pal = usePalette('default')
|
||||
|
@ -149,7 +155,7 @@ export function FeedSourceCardLoaded({
|
|||
style={[
|
||||
pal.border,
|
||||
{
|
||||
borderTopWidth: showMinimalPlaceholder ? 0 : 1,
|
||||
borderTopWidth: showMinimalPlaceholder || hideTopBorder ? 0 : 1,
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
flex: 1,
|
||||
|
@ -191,7 +197,12 @@ export function FeedSourceCardLoaded({
|
|||
<Pressable
|
||||
testID={`feed-${feed.displayName}`}
|
||||
accessibilityRole="button"
|
||||
style={[styles.container, pal.border, style]}
|
||||
style={[
|
||||
styles.container,
|
||||
pal.border,
|
||||
style,
|
||||
{borderTopWidth: hideTopBorder ? 0 : hairlineWidth},
|
||||
]}
|
||||
onPress={() => {
|
||||
if (feed.type === 'feed') {
|
||||
navigation.push('ProfileFeed', {
|
||||
|
@ -295,7 +306,6 @@ const styles = StyleSheet.create({
|
|||
paddingVertical: 20,
|
||||
flexDirection: 'column',
|
||||
flex: 1,
|
||||
borderTopWidth: 1,
|
||||
gap: 14,
|
||||
},
|
||||
headerContainer: {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import React from 'react'
|
||||
import {
|
||||
findNodeHandle,
|
||||
ListRenderItemInfo,
|
||||
StyleProp,
|
||||
StyleSheet,
|
||||
View,
|
||||
|
@ -134,7 +135,7 @@ export const ProfileFeedgens = React.forwardRef<
|
|||
// =
|
||||
|
||||
const renderItemInner = React.useCallback(
|
||||
({item}: {item: any}) => {
|
||||
({item, index}: ListRenderItemInfo<any>) => {
|
||||
if (item === EMPTY) {
|
||||
return (
|
||||
<View
|
||||
|
@ -169,6 +170,7 @@ export const ProfileFeedgens = React.forwardRef<
|
|||
preferences={preferences}
|
||||
style={styles.item}
|
||||
showLikes
|
||||
hideTopBorder={index === 0}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue