Resolve all remaining lint issues (#88)
* Rework 'navIdx' variables from number arrays to strings to avoid equality-check failures in react hooks * Resolve all remaining lint issues * Fix tests * Use node v18 in gh action test
This commit is contained in:
parent
3a90114f3a
commit
f36c956536
60 changed files with 478 additions and 482 deletions
|
@ -26,9 +26,13 @@ export const Profile = observer(({navIdx, visible, params}: ScreenParams) => {
|
|||
const [hasSetup, setHasSetup] = useState<boolean>(false)
|
||||
const uiState = React.useMemo(
|
||||
() => new ProfileUiModel(store, {user: params.name}),
|
||||
[params.user],
|
||||
[params.name, store],
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
store.nav.setTitle(navIdx, params.name)
|
||||
}, [store, navIdx, params.name])
|
||||
|
||||
useEffect(() => {
|
||||
let aborted = false
|
||||
const feedCleanup = uiState.feed.registerListeners()
|
||||
|
@ -38,7 +42,6 @@ export const Profile = observer(({navIdx, visible, params}: ScreenParams) => {
|
|||
if (hasSetup) {
|
||||
uiState.update()
|
||||
} else {
|
||||
store.nav.setTitle(navIdx, params.name)
|
||||
uiState.setup().then(() => {
|
||||
if (aborted) {
|
||||
return
|
||||
|
@ -50,7 +53,7 @@ export const Profile = observer(({navIdx, visible, params}: ScreenParams) => {
|
|||
aborted = true
|
||||
feedCleanup()
|
||||
}
|
||||
}, [visible, params.name, store])
|
||||
}, [visible, store, hasSetup, uiState])
|
||||
|
||||
// events
|
||||
// =
|
||||
|
@ -139,7 +142,7 @@ export const Profile = observer(({navIdx, visible, params}: ScreenParams) => {
|
|||
<EmptyState
|
||||
icon={['far', 'message']}
|
||||
message="No posts yet!"
|
||||
style={{paddingVertical: 40}}
|
||||
style={styles.emptyState}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
@ -187,7 +190,7 @@ export const Profile = observer(({navIdx, visible, params}: ScreenParams) => {
|
|||
|
||||
function LoadingMoreFooter() {
|
||||
return (
|
||||
<View style={{paddingVertical: 20}}>
|
||||
<View style={styles.loadingMoreFooter}>
|
||||
<ActivityIndicator />
|
||||
</View>
|
||||
)
|
||||
|
@ -202,6 +205,12 @@ const styles = StyleSheet.create({
|
|||
paddingVertical: 10,
|
||||
paddingHorizontal: 14,
|
||||
},
|
||||
emptyState: {
|
||||
paddingVertical: 40,
|
||||
},
|
||||
loadingMoreFooter: {
|
||||
paddingVertical: 20,
|
||||
},
|
||||
endItem: {
|
||||
paddingTop: 20,
|
||||
paddingBottom: 30,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue