Fix a few border nits (#4349)

* replace w/ hairline width

* no border for placeholder

* few notifications screen fixes tablet

* still show the border on desktop

* Simp

---------

Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
zio/stable
Hailey 2024-06-04 11:31:54 -07:00 committed by GitHub
parent d6b8313932
commit 9f001526d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 11 deletions

View File

@ -129,7 +129,11 @@ export function Feed({
) )
} else if (item === LOADING_ITEM) { } else if (item === LOADING_ITEM) {
return ( return (
<View style={[pal.border, {borderTopWidth: hairlineWidth}]}> <View
style={[
pal.border,
!isTabletOrMobile && {borderTopWidth: hairlineWidth},
]}>
<NotificationFeedLoadingPlaceholder /> <NotificationFeedLoadingPlaceholder />
</View> </View>
) )
@ -185,6 +189,7 @@ export function Feed({
desktopFixedHeight desktopFixedHeight
initialNumToRender={initialNumToRender} initialNumToRender={initialNumToRender}
windowSize={11} windowSize={11}
sideBorders={false}
/> />
</View> </View>
) )

View File

@ -29,6 +29,7 @@ import {colors, s} from 'lib/styles'
import {TextLink} from 'view/com/util/Link' import {TextLink} from 'view/com/util/Link'
import {ListMethods} from 'view/com/util/List' import {ListMethods} from 'view/com/util/List'
import {LoadLatestBtn} from 'view/com/util/load-latest/LoadLatestBtn' import {LoadLatestBtn} from 'view/com/util/load-latest/LoadLatestBtn'
import {CenteredView} from 'view/com/util/Views'
import {Feed} from '../com/notifications/Feed' import {Feed} from '../com/notifications/Feed'
import {FAB} from '../com/util/fab/FAB' import {FAB} from '../com/util/fab/FAB'
import {MainScrollProvider} from '../com/util/MainScrollProvider' import {MainScrollProvider} from '../com/util/MainScrollProvider'
@ -145,7 +146,10 @@ export function NotificationsScreen({}: Props) {
}, [isDesktop, pal, hasNew]) }, [isDesktop, pal, hasNew])
return ( return (
<View testID="notificationsScreen" style={s.hContentRegion}> <CenteredView
testID="notificationsScreen"
style={s.hContentRegion}
sideBorders={true}>
<ViewHeader <ViewHeader
title={_(msg`Notifications`)} title={_(msg`Notifications`)}
canGoBack={false} canGoBack={false}
@ -173,6 +177,6 @@ export function NotificationsScreen({}: Props) {
accessibilityLabel={_(msg`New post`)} accessibilityLabel={_(msg`New post`)}
accessibilityHint="" accessibilityHint=""
/> />
</View> </CenteredView>
) )
} }

View File

@ -32,6 +32,7 @@ import {NoFollowingFeed} from '#/screens/Feeds/NoFollowingFeed'
import {NoSavedFeedsOfAnyType} from '#/screens/Feeds/NoSavedFeedsOfAnyType' import {NoSavedFeedsOfAnyType} from '#/screens/Feeds/NoSavedFeedsOfAnyType'
import {atoms as a, useTheme} from '#/alf' import {atoms as a, useTheme} from '#/alf'
import {FilterTimeline_Stroke2_Corner0_Rounded as FilterTimeline} from '#/components/icons/FilterTimeline' import {FilterTimeline_Stroke2_Corner0_Rounded as FilterTimeline} from '#/components/icons/FilterTimeline'
import hairlineWidth = StyleSheet.hairlineWidth
const HITSLOP_TOP = { const HITSLOP_TOP = {
top: 20, top: 20,
@ -92,7 +93,7 @@ export function SavedFeeds({}: Props) {
<ViewHeader title={_(msg`Edit My Feeds`)} showOnDesktop showBorder /> <ViewHeader title={_(msg`Edit My Feeds`)} showOnDesktop showBorder />
<ScrollView style={s.flex1} contentContainerStyle={[styles.noBorder]}> <ScrollView style={s.flex1} contentContainerStyle={[styles.noBorder]}>
{noSavedFeedsOfAnyType && ( {noSavedFeedsOfAnyType && (
<View style={[pal.border, {borderBottomWidth: 1}]}> <View style={[pal.border, {borderBottomWidth: hairlineWidth}]}>
<NoSavedFeedsOfAnyType /> <NoSavedFeedsOfAnyType />
</View> </View>
)} )}
@ -134,7 +135,7 @@ export function SavedFeeds({}: Props) {
)} )}
{noFollowingFeed && ( {noFollowingFeed && (
<View style={[pal.border, {borderBottomWidth: 1}]}> <View style={[pal.border, {borderBottomWidth: hairlineWidth}]}>
<NoFollowingFeed /> <NoFollowingFeed />
</View> </View>
)} )}
@ -298,9 +299,10 @@ function ListItem({
<FeedSourceCard <FeedSourceCard
key={feedUri} key={feedUri}
feedUri={feedUri} feedUri={feedUri}
style={[styles.noTopBorder, isPinned && {paddingRight: 8}]} style={[isPinned && {paddingRight: 8}]}
showMinimalPlaceholder showMinimalPlaceholder
showSaveBtn={!isPinned} showSaveBtn={!isPinned}
hideTopBorder={true}
/> />
)} )}
{isPinned ? ( {isPinned ? (
@ -435,15 +437,12 @@ const styles = StyleSheet.create({
paddingHorizontal: 14, paddingHorizontal: 14,
paddingTop: 20, paddingTop: 20,
paddingBottom: 10, paddingBottom: 10,
borderBottomWidth: 1, borderBottomWidth: hairlineWidth,
}, },
itemContainer: { itemContainer: {
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
borderBottomWidth: 1, borderBottomWidth: hairlineWidth,
},
noTopBorder: {
borderTopWidth: 0,
}, },
footerText: { footerText: {
paddingHorizontal: 26, paddingHorizontal: 26,