mirror of https://github.com/tooot-app/app
commit
7eb5cdd523
|
@ -1,176 +0,0 @@
|
|||
{
|
||||
"pageParams": [],
|
||||
"pages": [
|
||||
[
|
||||
{
|
||||
"id": "999",
|
||||
"created_at": "2021-01-24T11:50:00.901Z",
|
||||
"sensitive": false,
|
||||
"visibility": "public",
|
||||
"replies_count": 9,
|
||||
"reblogs_count": 15,
|
||||
"favourites_count": 8,
|
||||
"favourited": false,
|
||||
"reblogged": true,
|
||||
"muted": false,
|
||||
"bookmarked": false,
|
||||
"content": "<p>Would you like to try out this simple and open-source mobile app for Mastodon? 😊</p>",
|
||||
"reblog": null,
|
||||
"application": {
|
||||
"name": "tooot",
|
||||
"website": "https://tooot.app"
|
||||
},
|
||||
"account": {
|
||||
"id": "999",
|
||||
"username": "tooot📱",
|
||||
"acct": "tooot@xmflsct.com",
|
||||
"display_name": "tooot📱",
|
||||
"avatar_static": "https://avatars.githubusercontent.com/u/77554750?s=200&v=4"
|
||||
},
|
||||
"media_attachments": [],
|
||||
"poll": {
|
||||
"id": "1",
|
||||
"expires_at": "2021-01-31T11:50:00.901Z",
|
||||
"expired": false,
|
||||
"multiple": false,
|
||||
"votes_count": 10,
|
||||
"voters_count": null,
|
||||
"voted": false,
|
||||
"own_votes": null,
|
||||
"options": [
|
||||
{
|
||||
"title": "I would love to!",
|
||||
"votes_count": 6
|
||||
},
|
||||
{
|
||||
"title": "Why not give it a go?",
|
||||
"votes_count": 4
|
||||
}
|
||||
],
|
||||
"emojis": []
|
||||
},
|
||||
"mentions": []
|
||||
},
|
||||
{
|
||||
"id": "1000",
|
||||
"created_at": "2021-01-24T10:50:00.901Z",
|
||||
"sensitive": false,
|
||||
"spoiler_text": "",
|
||||
"visibility": "public",
|
||||
"replies_count": 5,
|
||||
"reblogs_count": 6,
|
||||
"favourites_count": 11,
|
||||
"favourited": true,
|
||||
"reblogged": false,
|
||||
"muted": false,
|
||||
"bookmarked": false,
|
||||
"content": "<p>Mastodon is a free and open-source self-hosted social networking service. It allows anyone to host their own server node in the network, and its various separately operated user bases are federated across many different servers. These nodes are referred to as \"instances\" by Mastodon users.</p>",
|
||||
"reblog": null,
|
||||
"application": {
|
||||
"name": "Web",
|
||||
"website": null
|
||||
},
|
||||
"account": {
|
||||
"id": "1000",
|
||||
"username": "Mastodon",
|
||||
"acct": "mastodon",
|
||||
"display_name": "Mastodon",
|
||||
"avatar_static": "https://cdn.dnaindia.com/sites/default/files/styles/full/public/2017/04/06/563120-123.jpg"
|
||||
},
|
||||
"media_attachments": [],
|
||||
"card": {
|
||||
"url": "https://joinmastodon.org/",
|
||||
"title": "Giving social networking back to you - Mastodon",
|
||||
"description": "Mastodon is an open source decentralized social network - by the people for the people. Join the federation and take back control of your social media!",
|
||||
"type": "link",
|
||||
"image": "https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Mastodon_Logotype_%28Simple%29.svg/1200px-Mastodon_Logotype_%28Simple%29.svg.png"
|
||||
},
|
||||
"mentions": []
|
||||
},
|
||||
{
|
||||
"id": "1001",
|
||||
"created_at": "2021-01-24T09:50:00.901Z",
|
||||
"spoiler_text": "",
|
||||
"visibility": "public",
|
||||
"replies_count": 2,
|
||||
"reblogs_count": null,
|
||||
"favourites_count": 3,
|
||||
"favourited": false,
|
||||
"reblogged": false,
|
||||
"muted": false,
|
||||
"bookmarked": true,
|
||||
"content": "<p>These servers are connected as a federated social network, allowing users from different servers to interact with each other seamlessly. Once a Mastodon server knows another Mastodon server, it \"federates\" with the other Mastodon server. Mastodon is a part of the wider Fediverse, allowing its users to also interact with users on different open platforms that support the same protocol, such as PeerTube and Friendica.</p>",
|
||||
"reblog": null,
|
||||
"application": {
|
||||
"name": "Web",
|
||||
"website": null
|
||||
},
|
||||
"account": {
|
||||
"id": "1001",
|
||||
"username": "Fediverse",
|
||||
"acct": "fediverse",
|
||||
"display_name": "Fediverse",
|
||||
"avatar_static": "https://e7.pngegg.com/pngimages/667/514/png-clipart-mastodon-fediverse-social-media-free-software-logo-social-media-blue-text.png"
|
||||
},
|
||||
"media_attachments": [],
|
||||
"mentions": []
|
||||
},
|
||||
{
|
||||
"id": "1002",
|
||||
"created_at": "2021-01-24T08:50:00.901Z",
|
||||
"sensitive": false,
|
||||
"visibility": "public",
|
||||
"replies_count": 0,
|
||||
"reblogs_count": 0,
|
||||
"favourites_count": 0,
|
||||
"favourited": true,
|
||||
"reblogged": false,
|
||||
"muted": false,
|
||||
"bookmarked": false,
|
||||
"content": "<p>tooot is an open source, simple mobile client for Mastodon. Focusing on your connections while being able to explore the Fediverse.</p>",
|
||||
"reblog": null,
|
||||
"application": {
|
||||
"name": "tooot",
|
||||
"website": "https://tooot.app"
|
||||
},
|
||||
"account": {
|
||||
"id": "1002",
|
||||
"username": "tooot📱",
|
||||
"acct": "tooot@xmflsct.com",
|
||||
"display_name": "tooot📱",
|
||||
"avatar_static": "https://avatars.githubusercontent.com/u/77554750?s=200&v=4"
|
||||
},
|
||||
"media_attachments": [],
|
||||
"mentions": []
|
||||
},
|
||||
{
|
||||
"id": "1003",
|
||||
"created_at": "2021-01-24T07:50:00.901Z",
|
||||
"sensitive": false,
|
||||
"visibility": "public",
|
||||
"replies_count": 0,
|
||||
"reblogs_count": 0,
|
||||
"favourites_count": 0,
|
||||
"favourited": true,
|
||||
"reblogged": false,
|
||||
"muted": false,
|
||||
"bookmarked": false,
|
||||
"content": "<p>- tooot supports multiple accounts<br />- tooot supports browsing external instance<br />- tooot aims to support multiple languages</p>",
|
||||
"reblog": null,
|
||||
"application": {
|
||||
"name": "tooot",
|
||||
"website": "https://tooot.app"
|
||||
},
|
||||
"account": {
|
||||
"id": "1003",
|
||||
"username": "tooot📱",
|
||||
"acct": "tooot@xmflsct.com",
|
||||
"display_name": "tooot📱",
|
||||
"avatar_static": "https://avatars.githubusercontent.com/u/77554750?s=200&v=4"
|
||||
},
|
||||
"media_attachments": [],
|
||||
"mentions": []
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
|
@ -0,0 +1,185 @@
|
|||
const demoStatuses = [
|
||||
{
|
||||
id: '1',
|
||||
created_at: new Date().toISOString(),
|
||||
sensitive: false,
|
||||
visibility: 'public',
|
||||
replies_count: 9,
|
||||
reblogs_count: 15,
|
||||
favourites_count: 8,
|
||||
favourited: true,
|
||||
reblogged: false,
|
||||
muted: false,
|
||||
bookmarked: false,
|
||||
content:
|
||||
'<p>Would you like to try out this simple, beautiful and open-source mobile app for Mastodon? 😊</p>',
|
||||
reblog: null,
|
||||
application: {
|
||||
name: 'tooot',
|
||||
website: 'https://tooot.app'
|
||||
},
|
||||
account: {
|
||||
id: '999',
|
||||
username: 'tooot📱',
|
||||
acct: 'tooot@xmflsct.com',
|
||||
display_name: 'tooot📱',
|
||||
avatar_static:
|
||||
'https://avatars.githubusercontent.com/u/77554750?s=200&v=4'
|
||||
},
|
||||
media_attachments: [],
|
||||
poll: {
|
||||
id: '1',
|
||||
expires_at: new Date().setDate(new Date().getDate() + 5),
|
||||
expired: false,
|
||||
multiple: false,
|
||||
votes_count: 10,
|
||||
voters_count: null,
|
||||
voted: false,
|
||||
own_votes: null,
|
||||
options: [
|
||||
{
|
||||
title: 'I would love to!',
|
||||
votes_count: 6
|
||||
},
|
||||
{
|
||||
title: 'Why not give it a go?',
|
||||
votes_count: 4
|
||||
}
|
||||
],
|
||||
emojis: []
|
||||
},
|
||||
mentions: []
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
created_at: new Date().setMinutes(new Date().getMinutes() - 2),
|
||||
sensitive: false,
|
||||
spoiler_text: '',
|
||||
visibility: 'public',
|
||||
replies_count: 5,
|
||||
reblogs_count: 6,
|
||||
favourites_count: 11,
|
||||
favourited: true,
|
||||
reblogged: false,
|
||||
muted: false,
|
||||
bookmarked: false,
|
||||
content:
|
||||
'<p>Mastodon is a free and open-source self-hosted social networking service. It allows anyone to host their own server node in the network, and its various separately operated user bases are federated across many different servers. These nodes are referred to as "instances" by Mastodon users.</p>',
|
||||
reblog: null,
|
||||
application: {
|
||||
name: 'Web',
|
||||
website: null
|
||||
},
|
||||
account: {
|
||||
id: '1000',
|
||||
username: 'Mastodon',
|
||||
acct: 'mastodon',
|
||||
display_name: 'Mastodon',
|
||||
avatar_static:
|
||||
'https://mastodon.social/apple-touch-icon.png'
|
||||
},
|
||||
media_attachments: [],
|
||||
card: {
|
||||
url: 'https://joinmastodon.org/',
|
||||
title: 'Giving social networking back to you - Mastodon',
|
||||
description:
|
||||
'Mastodon is an open source decentralized social network - by the people for the people. Join the federation and take back control of your social media!',
|
||||
type: 'link',
|
||||
image:
|
||||
'https://mastodon.social/apple-touch-icon.png'
|
||||
},
|
||||
mentions: []
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
created_at: '2021-01-24T09:50:00.901Z',
|
||||
spoiler_text: '',
|
||||
visibility: 'public',
|
||||
replies_count: 2,
|
||||
reblogs_count: null,
|
||||
favourites_count: 3,
|
||||
favourited: false,
|
||||
reblogged: false,
|
||||
muted: false,
|
||||
bookmarked: true,
|
||||
content:
|
||||
'<p>These servers are connected as a federated social network, allowing users from different servers to interact with each other seamlessly. Once a Mastodon server knows another Mastodon server, it "federates" with the other Mastodon server. Mastodon is a part of the wider Fediverse, allowing its users to also interact with users on different open platforms that support the same protocol, such as PeerTube and Friendica.</p>',
|
||||
reblog: null,
|
||||
application: {
|
||||
name: 'Web',
|
||||
website: null
|
||||
},
|
||||
account: {
|
||||
id: '1001',
|
||||
username: 'Fediverse',
|
||||
acct: 'fediverse',
|
||||
display_name: 'Fediverse',
|
||||
avatar_static:
|
||||
'https://e7.pngegg.com/pngimages/667/514/png-clipart-mastodon-fediverse-social-media-free-software-logo-social-media-blue-text.png'
|
||||
},
|
||||
media_attachments: [],
|
||||
mentions: []
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
created_at: '2021-01-24T08:50:00.901Z',
|
||||
sensitive: false,
|
||||
visibility: 'public',
|
||||
replies_count: 0,
|
||||
reblogs_count: 0,
|
||||
favourites_count: 0,
|
||||
favourited: true,
|
||||
reblogged: false,
|
||||
muted: false,
|
||||
bookmarked: false,
|
||||
content:
|
||||
'<p>tooot is an open source, simple mobile client for Mastodon. Focusing on your connections while being able to explore the Fediverse.</p>',
|
||||
reblog: null,
|
||||
application: {
|
||||
name: 'tooot',
|
||||
website: 'https://tooot.app'
|
||||
},
|
||||
account: {
|
||||
id: '1002',
|
||||
username: 'tooot📱',
|
||||
acct: 'tooot@xmflsct.com',
|
||||
display_name: 'tooot📱',
|
||||
avatar_static:
|
||||
'https://avatars.githubusercontent.com/u/77554750?s=200&v=4'
|
||||
},
|
||||
media_attachments: [],
|
||||
mentions: []
|
||||
},
|
||||
{
|
||||
id: '5',
|
||||
created_at: '2021-01-24T07:50:00.901Z',
|
||||
sensitive: false,
|
||||
visibility: 'public',
|
||||
replies_count: 0,
|
||||
reblogs_count: 0,
|
||||
favourites_count: 0,
|
||||
favourited: true,
|
||||
reblogged: false,
|
||||
muted: false,
|
||||
bookmarked: false,
|
||||
content:
|
||||
'<p>- tooot supports multiple accounts<br />- tooot supports browsing external instance<br />- tooot aims to support multiple languages</p>',
|
||||
reblog: null,
|
||||
application: {
|
||||
name: 'tooot',
|
||||
website: 'https://tooot.app'
|
||||
},
|
||||
account: {
|
||||
id: '1003',
|
||||
username: 'tooot📱',
|
||||
acct: 'tooot@xmflsct.com',
|
||||
display_name: 'tooot📱',
|
||||
avatar_static:
|
||||
'https://avatars.githubusercontent.com/u/77554750?s=200&v=4'
|
||||
},
|
||||
media_attachments: [],
|
||||
mentions: []
|
||||
}
|
||||
]
|
||||
|
||||
export default demoStatuses
|
|
@ -8,6 +8,7 @@ export interface Props {
|
|||
type?: 'icon' | 'text'
|
||||
content?: string
|
||||
native?: boolean
|
||||
background?: boolean
|
||||
|
||||
onPress: () => void
|
||||
}
|
||||
|
@ -16,6 +17,7 @@ const HeaderLeft: React.FC<Props> = ({
|
|||
type = 'icon',
|
||||
content,
|
||||
native = true,
|
||||
background = false,
|
||||
onPress
|
||||
}) => {
|
||||
const { theme } = useTheme()
|
||||
|
@ -47,11 +49,19 @@ const HeaderLeft: React.FC<Props> = ({
|
|||
style={[
|
||||
styles.base,
|
||||
{
|
||||
backgroundColor: theme.backgroundOverlayDefault,
|
||||
backgroundColor: background
|
||||
? theme.backgroundOverlayDefault
|
||||
: undefined,
|
||||
minHeight: 44,
|
||||
minWidth: 44,
|
||||
marginLeft: native
|
||||
? -StyleConstants.Spacing.S
|
||||
: StyleConstants.Spacing.S,
|
||||
...(type === 'icon' && {
|
||||
height: 44,
|
||||
width: 44,
|
||||
marginLeft: native ? -9 : 9
|
||||
borderRadius: 100
|
||||
}),
|
||||
...(type === 'text' && {
|
||||
paddingHorizontal: StyleConstants.Spacing.S
|
||||
})
|
||||
}
|
||||
]}
|
||||
|
@ -63,8 +73,7 @@ const styles = StyleSheet.create({
|
|||
base: {
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
borderRadius: 100
|
||||
alignItems: 'center'
|
||||
},
|
||||
text: {
|
||||
...StyleConstants.FontStyle.M
|
||||
|
|
|
@ -9,6 +9,7 @@ export interface Props {
|
|||
type?: 'icon' | 'text'
|
||||
content: string
|
||||
native?: boolean
|
||||
background?: boolean
|
||||
|
||||
loading?: boolean
|
||||
disabled?: boolean
|
||||
|
@ -20,6 +21,7 @@ const HeaderRight: React.FC<Props> = ({
|
|||
type = 'icon',
|
||||
content,
|
||||
native = true,
|
||||
background = false,
|
||||
loading,
|
||||
disabled,
|
||||
onPress
|
||||
|
@ -79,11 +81,19 @@ const HeaderRight: React.FC<Props> = ({
|
|||
style={[
|
||||
styles.base,
|
||||
{
|
||||
backgroundColor: theme.backgroundOverlayDefault,
|
||||
backgroundColor: background
|
||||
? theme.backgroundOverlayDefault
|
||||
: undefined,
|
||||
minHeight: 44,
|
||||
minWidth: 44,
|
||||
marginLeft: native
|
||||
? -StyleConstants.Spacing.S
|
||||
: StyleConstants.Spacing.S,
|
||||
...(type === 'icon' && {
|
||||
height: 44,
|
||||
width: 44,
|
||||
marginRight: native ? -9 : 9
|
||||
borderRadius: 100
|
||||
}),
|
||||
...(type === 'text' && {
|
||||
paddingHorizontal: StyleConstants.Spacing.S
|
||||
})
|
||||
}
|
||||
]}
|
||||
|
@ -95,8 +105,7 @@ const styles = StyleSheet.create({
|
|||
base: {
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
borderRadius: 100
|
||||
alignItems: 'center'
|
||||
},
|
||||
text: {
|
||||
...StyleConstants.FontStyle.M
|
||||
|
|
|
@ -37,7 +37,7 @@ const TimelinePoll: React.FC<Props> = ({
|
|||
sameAccount
|
||||
}) => {
|
||||
const { mode, theme } = useTheme()
|
||||
const { t } = useTranslation('componentTimeline')
|
||||
const { t, i18n } = useTranslation('componentTimeline')
|
||||
|
||||
const [allOptions, setAllOptions] = useState(
|
||||
new Array(poll.options.length).fill(false)
|
||||
|
@ -136,7 +136,14 @@ const TimelinePoll: React.FC<Props> = ({
|
|||
)
|
||||
}
|
||||
}
|
||||
}, [mode, poll.expired, poll.voted, allOptions, mutation.isLoading])
|
||||
}, [
|
||||
mode,
|
||||
i18n.language,
|
||||
poll.expired,
|
||||
poll.voted,
|
||||
allOptions,
|
||||
mutation.isLoading
|
||||
])
|
||||
|
||||
const pollExpiration = useMemo(() => {
|
||||
if (poll.expired) {
|
||||
|
@ -155,7 +162,7 @@ const TimelinePoll: React.FC<Props> = ({
|
|||
</Text>
|
||||
)
|
||||
}
|
||||
}, [mode, poll.expired, poll.expires_at])
|
||||
}, [mode, i18n.language, poll.expired, poll.expires_at])
|
||||
|
||||
const isSelected = useCallback(
|
||||
(index: number): string =>
|
||||
|
@ -186,7 +193,9 @@ const TimelinePoll: React.FC<Props> = ({
|
|||
<Text style={styles.optionText}>
|
||||
<ParseEmojis content={option.title} emojis={poll.emojis} />
|
||||
</Text>
|
||||
<Text style={[styles.optionPercentage, { color: theme.primaryDefault }]}>
|
||||
<Text
|
||||
style={[styles.optionPercentage, { color: theme.primaryDefault }]}
|
||||
>
|
||||
{poll.votes_count
|
||||
? Math.round(
|
||||
(option.votes_count /
|
||||
|
|
|
@ -13,7 +13,7 @@ export default {
|
|||
},
|
||||
disclaimer: {
|
||||
base:
|
||||
"Logging in process uses system broswer that, your account informationo won't be visible to tooot app. Read more ",
|
||||
"Logging in process uses system broswer that, your account information won't be visible to tooot app. Read more ",
|
||||
privacy: 'privacy policy'
|
||||
}
|
||||
},
|
||||
|
|
|
@ -3,7 +3,8 @@ export default {
|
|||
prefixAgo: null,
|
||||
prefixFromNow: null,
|
||||
suffixAgo: 'ago',
|
||||
suffixFromNow: 'from now',
|
||||
// suffixFromNow: 'from now',
|
||||
suffixFromNow: null,
|
||||
seconds: '%d seconds',
|
||||
minute: 'about a minute',
|
||||
minutes: '%d minutes',
|
||||
|
|
|
@ -152,7 +152,7 @@ export default {
|
|||
},
|
||||
expiration: {
|
||||
expired: 'Vote expired',
|
||||
until: 'Open until <0 />'
|
||||
until: 'Expires in <0 />'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
export default {
|
||||
heading: 'Toot font size',
|
||||
heading: 'Toot Font Size',
|
||||
content: {
|
||||
showcase: 'Example toot',
|
||||
demo:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
export default {
|
||||
heading: 'Switch account',
|
||||
heading: 'Switch Account',
|
||||
content: {
|
||||
existing: 'Choose from logged in',
|
||||
new: 'Log in to instance'
|
||||
|
|
|
@ -62,7 +62,7 @@ const ComposePoll: React.FC = () => {
|
|||
? t('content.root.footer.poll.option.placeholder.multiple')
|
||||
: t('content.root.footer.poll.option.placeholder.single')
|
||||
}
|
||||
placeholderTextColor={theme.secondary}
|
||||
placeholderTextColor={theme.disabled}
|
||||
maxLength={50}
|
||||
// @ts-ignore
|
||||
value={options[i]}
|
||||
|
|
|
@ -49,6 +49,7 @@ const TabSharedAccount: React.FC<SharedAccountProp> = ({
|
|||
account
|
||||
})
|
||||
}}
|
||||
background
|
||||
/>
|
||||
)
|
||||
})
|
||||
|
|
|
@ -74,7 +74,9 @@ const sharedScreens = (
|
|||
backgroundColor: `rgba(255, 255, 255, 0)`
|
||||
},
|
||||
headerCenter: () => null,
|
||||
headerLeft: () => <HeaderLeft onPress={() => navigation.goBack()} />
|
||||
headerLeft: () => (
|
||||
<HeaderLeft onPress={() => navigation.goBack()} background />
|
||||
)
|
||||
}
|
||||
}}
|
||||
/>,
|
||||
|
|
Loading…
Reference in New Issue