1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Theme done

This commit is contained in:
Zhiyuan Zheng
2020-11-29 18:08:31 +01:00
parent 24d0681c9e
commit 1493e20962
24 changed files with 280 additions and 150 deletions

View File

@ -44,7 +44,7 @@ export interface Props {
const Timelines: React.FC<Props> = ({ name, content }) => {
const navigation = useNavigation()
const { theme } = useTheme()
const { mode, theme } = useTheme()
const localRegistered = useSelector(getLocalUrl)
const publicDomain = useSelector(getRemoteUrl)
const [segment, setSegment] = useState(0)
@ -107,6 +107,7 @@ const Timelines: React.FC<Props> = ({ name, content }) => {
headerCenter: () => (
<View style={styles.segmentsContainer}>
<SegmentedControl
appearance={mode}
values={[content[0].title, content[1].title]}
selectedIndex={segment}
onChange={onChangeSegment}

View File

@ -88,6 +88,7 @@ const TimelineDefault: React.FC<Props> = ({ item, queryKey }) => {
emojis={actualStatus.account.emojis}
account={actualStatus.account.acct}
created_at={item.created_at}
visibility={item.visibility}
application={item.application}
/>
{/* Can pass toot info to next page to speed up performance */}

View File

@ -98,6 +98,7 @@ export interface Props {
emojis?: Mastodon.Emoji[]
account: string
created_at: string
visibility: Mastodon.Status['visibility']
application?: Mastodon.Application
}
@ -109,6 +110,7 @@ const HeaderDefault: React.FC<Props> = ({
emojis,
account,
created_at,
visibility,
application
}) => {
const { theme } = useTheme()
@ -197,6 +199,14 @@ const HeaderDefault: React.FC<Props> = ({
{since}
</Text>
</View>
{visibility === 'private' && (
<Feather
name='lock'
size={constants.FONT_SIZE_S}
color={theme.secondary}
style={styles.visibility}
/>
)}
{application && application.name !== 'Web' && (
<View>
<Text
@ -292,12 +302,16 @@ const styles = StyleSheet.create({
},
meta: {
flexDirection: 'row',
alignItems: 'center',
marginTop: constants.SPACING_XS,
marginBottom: constants.SPACING_S
},
created_at: {
fontSize: constants.FONT_SIZE_S
},
visibility: {
marginLeft: constants.SPACING_S
},
application: {
fontSize: constants.FONT_SIZE_S,
marginLeft: constants.SPACING_S