Skip to content

Commit

Permalink
feat: doc & ui
Browse files Browse the repository at this point in the history
  • Loading branch information
liaoliao666 committed Dec 22, 2022
1 parent 257d9ce commit f41c8b2
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 81 deletions.
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# V2EX APP
> V2EX第三方客户端,原生 App,支持夜间模式。

## Preview
> V2EX 好看的第三方客户端,原生 App,支持夜间模式。
## 预览

![Preview](https://files.catbox.moe/q6sy9n.gif)

## 下载

[iOS App Store](https://apps.apple.com/cn/app/awesomev2ex/id1659591551?l=en)
[Android Apk](https://github.com/liaoliao666/v2ex/releases/download/1.0.1/application-4df3dc61-5a96-4478-9aae-9ed8151122b1.apk)

## 本地运行

[Expo 文档](https://docs.expo.dev/)

## Issues

希望做出贡献? [Good First Issue][good-first-issue]
Expand All @@ -18,7 +28,7 @@
### 💡 新功能建议

请提交问题以建议新功能。 通过添加对功能请求进行投票
一个👍。 这有助于作者确定工作的优先级。
一个 👍。 这有助于作者确定工作的优先级。

[**See Feature Requests**][requests]

Expand All @@ -30,4 +40,4 @@ MIT
[bugs]: https://github.com/liaoliao666/v2ex/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+sort%3Acreated-desc+label%3Abug
[requests]: https://github.com/liaoliao666/v2ex/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+label%3Aenhancement
[good-first-issue]: https://github.com/liaoliao666/v2ex/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+label%3Aenhancement+label%3A%22good+first+issue%22
<!-- prettier-ignore-end -->
<!-- prettier-ignore-end -->
12 changes: 5 additions & 7 deletions components/topic/ReplyItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,12 @@ function ReplyItem({
</Text>
</View>

<View style={tw`pt-1`}>
<Text style={tw`text-tint-secondary text-body-5`}>
{dayjs(reply.created).fromNow()}
{reply.via ? ` via ${reply.via}` : ``}
</Text>
</View>
<Text style={tw`text-tint-secondary text-body-6`}>
{dayjs(reply.created).fromNow()}
{reply.via ? ` via ${reply.via}` : ``}
</Text>

<View style={tw`pt-2`}>
<View style={tw`pt-0.5`}>
<Html
source={{ html: reply.content }}
inModalScreen={inModalScreen}
Expand Down
61 changes: 34 additions & 27 deletions components/topic/TopicInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function TopicInfo({ topic, onReply }: { topic: Topic; onReply: () => void }) {
</Text>
</View>

<Separator style={tw`mt-1 flex-1`}>
<Separator style={tw`flex-1`}>
{compact([
topic.created && (
<Text key="created" style={tw`text-tint-secondary text-body-5`}>
Expand All @@ -101,38 +101,45 @@ function TopicInfo({ topic, onReply }: { topic: Topic; onReply: () => void }) {
</Text>

{!!topic.content && (
<View style={tw`py-2`}>
<View style={tw`pt-2`}>
<Html source={{ html: topic.content }} />
</View>
)}

{topic.supplements?.map((supplement, i) => (
<View
key={supplement.created}
style={tw`border-t border-solid border-tint-border py-2`}
>
<Separator>
{[
<Text key="i" style={tw`text-tint-secondary text-body-5`}>
{i + 1}条附言
</Text>,
<Text key="created" style={tw`text-tint-secondary text-body-5`}>
{supplement.created}
</Text>,
]}
</Separator>

<View style={tw`pt-1`}>
<Html
source={{
html: supplement.content,
}}
/>
</View>
{!!topic.supplements?.length && (
<View style={tw`pt-2`}>
{topic.supplements.map((supplement, i) => (
<View
key={supplement.created}
style={tw`border-t border-solid border-tint-border py-2`}
>
<Separator>
{[
<Text key="i" style={tw`text-tint-secondary text-body-5`}>
{i + 1}条附言
</Text>,
<Text
key="created"
style={tw`text-tint-secondary text-body-5`}
>
{supplement.created}
</Text>,
]}
</Separator>

<View style={tw`pt-1`}>
<Html
source={{
html: supplement.content,
}}
/>
</View>
</View>
))}
</View>
))}
)}

<View style={tw`flex-row items-center justify-between pt-2`}>
<View style={tw.style(`flex-row items-center justify-between pt-2`)}>
<VoteButton topic={topic} />

<Space style={tw`ml-4 mr-auto items-center`}>
Expand Down
6 changes: 5 additions & 1 deletion eas.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
"distribution": "internal"
},
"preview": {
"distribution": "internal"
"distribution": "internal",
"android": {
"buildType": "apk",
"gradleCommand": ":app:assembleRelease"
}
},
"production": {}
},
Expand Down
82 changes: 40 additions & 42 deletions screens/RelatedRepliesScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,50 +161,48 @@ export default function RelatedRepliesScreen() {
width: layout.width,
}}
renderTabBar={props => (
<View style={tw`pl-4`}>
<TabBar
{...props}
scrollEnabled
style={tw`bg-body-1 flex-row shadow-none border-b border-tint-border border-solid`}
tabStyle={tw`w-[100px] h-[${NAV_BAR_HEIGHT}px]`}
indicatorStyle={tw`w-[40px] ml-[30px] bg-primary h-1 rounded-full`}
indicatorContainerStyle={tw`border-0`}
renderTabBarItem={({ route }) => {
const active = currentRoute.key === route.key
<TabBar
{...props}
scrollEnabled
style={tw`bg-body-1 flex-row shadow-none border-b border-tint-border border-solid`}
tabStyle={tw`w-[100px] h-[${NAV_BAR_HEIGHT}px]`}
indicatorStyle={tw`w-[40px] ml-[30px] bg-primary h-1 rounded-full`}
indicatorContainerStyle={tw`border-0`}
renderTabBarItem={({ route }) => {
const active = currentRoute.key === route.key

return (
<Pressable
key={route.key}
style={({ pressed }) =>
tw.style(
`w-[100px] flex-row items-center justify-center h-[${NAV_BAR_HEIGHT}px]`,
pressed && tw`bg-tab-press`
)
}
onPress={() => {
setIndex(findIndex(routes, { key: route.key }))
}}
return (
<Pressable
key={route.key}
style={({ pressed }) =>
tw.style(
`w-[100px] flex-row items-center justify-center h-[${NAV_BAR_HEIGHT}px]`,
pressed && tw`bg-tab-press`
)
}
onPress={() => {
setIndex(findIndex(routes, { key: route.key }))
}}
>
<StyledImage
style={tw`w-5 h-5 rounded-full`}
source={{ uri: route.avatar }}
/>
<Text
style={tw.style(
`ml-2 text-body-5 flex-shrink`,
active
? tw`text-tint-primary font-bold`
: tw`text-tint-secondary font-medium`
)}
numberOfLines={1}
>
<StyledImage
style={tw`w-5 h-5 rounded-full`}
source={{ uri: route.avatar }}
/>
<Text
style={tw.style(
`ml-2 text-body-5 flex-shrink`,
active
? tw`text-tint-primary font-bold`
: tw`text-tint-secondary font-medium`
)}
numberOfLines={1}
>
{route.title}
</Text>
</Pressable>
)
}}
/>
</View>
{route.title}
</Text>
</Pressable>
)
}}
/>
)}
/>
)}
Expand Down

0 comments on commit f41c8b2

Please sign in to comment.