-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mobile context menu #122
Draft
thomasgwatson
wants to merge
64
commits into
dev
Choose a base branch
from
mobile-context-menu
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Mobile context menu #122
Changes from 48 commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
87b425b
Nativewind config confirmed by verifyInstallation()
thomasgwatson 6cb75ff
Starting to split the drawer nav between GlobalNav and ContextMenu
thomasgwatson 86afcd2
Merge branch 'dev' into mobile-context-menu
thomasgwatson 2e84afb
Merge branch 'dev' into mobile-context-menu
thomasgwatson c9fc0e9
Add key to globalNav list items
thomasgwatson 8137c2d
GlobalNav updates WIP
thomasgwatson 36a2ab8
Merge branch 'dev' into mobile-context-menu
thomasgwatson e71535b
Allow nav to myHome via bottomNavTab. Use context widgets for myHome …
thomasgwatson 203130f
Merge branch 'dev' into mobile-context-menu
thomasgwatson 5cc9d09
Merge branch 'urql-poc' into mobile-context-menu
thomasgwatson d78dd73
Merge branch 'dev' into mobile-context-menu
thomasgwatson 000082a
Fix busted bracket
thomasgwatson bcd0aca
Merge branch 'dev' into mobile-context-menu
thomasgwatson ecede9e
Merge branch 'urql-poc' into mobile-context-menu
thomasgwatson ca441e7
Add widget titles to locales
thomasgwatson 10e91c9
Add lucide icons. Add nativewind themes config. Add CSS variables for…
thomasgwatson a7712b4
Merge branch 'dev' into mobile-context-menu
thomasgwatson 71e0ff9
Add Luxon as dependency to mobile
thomasgwatson ff71c8b
Flesh out context menu items for mobile
thomasgwatson 214cf94
wip
thomasgwatson 5b5d4f2
Merge branch 'dev' into mobile-context-menu
thomasgwatson c58f3da
Merge branch 'urql-poc' into mobile-context-menu
thomasgwatson 2353e3f
Merge fixes and ensuring Android builds
thomasgwatson 8af2ce9
Add homeWidget to Group graphQL interface
thomasgwatson 0758434
Add homeWidget to graphql fragments. Tweak widget helpers. WIP on nav…
thomasgwatson a2864a9
Merge branch 'dev' into mobile-context-menu
thomasgwatson 45cd04b
Merge branch 'urql-poc' into mobile-context-menu
thomasgwatson ee888eb
Added pager-view
thomasgwatson a80358c
Merge branch 'dev' into mobile-context-menu
thomasgwatson 8e55708
Merge branch 'urql-poc' into mobile-context-menu
thomasgwatson 7f2b9e2
Add basic all view to the mobile context menu
thomasgwatson 608a202
Just use navigation.navigate for navigation. Several links/navigation…
thomasgwatson b5be525
Merge branch 'urql-poc' into mobile-context-menu
thomasgwatson 19a7f76
Merge branch 'urql-poc' into mobile-context-menu
thomasgwatson ce86161
Somehow the webView was crashing without this undefined guard
thomasgwatson 55966ab
Merge branch 'urql-poc' into mobile-context-menu
thomasgwatson e9530b3
Podlocccck
thomasgwatson 3b31d72
Cleanup
thomasgwatson 8b2b3bf
Fix unnecessary render of childPost notice on my context posts
thomasgwatson 310e5cf
Correct an import on FlagContent
thomasgwatson f882b87
Merge branch 'urql-poc' into mobile-context-menu
thomasgwatson 393ed6a
Merge branch 'dev' into mobile-context-menu
thomasgwatson 47a7581
Go away
thomasgwatson 26521bf
Correct default context for widgetUrl function
thomasgwatson fd98425
Add logout functionality to my Context Menu
thomasgwatson e4d0024
Extending GlobalNav
thomasgwatson 35b333a
Merge branch 'dev' into mobile-context-menu
lorenjohnson 1baed52
Merge branch 'mobile-context-menu' of https://github.com/Hylozoic/hyl…
thomasgwatson c45be24
Merge branch 'dev' into mobile-context-menu
lorenjohnson 8496bf2
chore(mobile): Fix some things with WIP new nav and design, add comments
lorenjohnson 60e4e5b
Merge branch 'mobile-context-menu' of https://github.com/Hylozoic/hyl…
thomasgwatson 8d3570e
Merge branch 'dev' into mobile-context-menu
thomasgwatson 69a642a
Tweaks of Loren tweaks
thomasgwatson e7b9cfe
Merge branch 'dev' into mobile-context-menu
thomasgwatson 2875b67
chore(mobile): openURL / Linking debugging
lorenjohnson 35e1298
chore(mobile): Adds some documentation and debugging to useOpenURL / …
lorenjohnson df7faa3
chore(mobile): Fix AllView usage of shared helpers
lorenjohnson 259bd5f
Ransack tab bar navigator
thomasgwatson 623e508
Merge branch 'mobile-context-menu' of https://github.com/Hylozoic/hyl…
thomasgwatson 0338074
Merge branch 'dev' into mobile-context-menu
thomasgwatson aac4442
Clean up double import post branch-merge
thomasgwatson 91b41d5
Merge branch 'locales-mobile' into mobile-context-menu
thomasgwatson 7a84ae4
Merge branch 'dev' into mobile-context-menu
thomasgwatson 652cb5f
Merge branch 'dev' into mobile-context-menu
thomasgwatson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/// <reference types="nativewind/types" /> | ||
|
||
// NOTE: This file should not be edited and should be committed with your source code. It is generated by NativeWind. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
apps/mobile/src/components/GroupMenuHeader/GroupMenuHeader.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import React, { useState, useEffect } from 'react' | ||
import { Settings, Users, ChevronRight } from 'lucide-react-native' | ||
import { View, Text, TouchableOpacity } from 'react-native' | ||
import { useTranslation } from 'react-i18next' | ||
import { useNavigation } from '@react-navigation/native' | ||
import FastImage from 'react-native-fast-image' | ||
import Avatar from 'components/Avatar' | ||
import { RESP_ADMINISTRATION } from 'store/constants' | ||
// import { DEFAULT_BANNER, DEFAULT_AVATAR } from 'store/models/Group' | ||
import useHasResponsibility from 'hooks/useHasResponsibility' | ||
import { cn } from '../../util' | ||
|
||
export default function GroupMenuHeader ({ group }) { | ||
const { t } = useTranslation() | ||
const navigation = useNavigation() | ||
const avatarUrl = group.avatarUrl | ||
const bannerUrl = group.bannerUrl | ||
const [textColor, setTextColor] = useState('background') | ||
const hasResponsibility = useHasResponsibility({ forCurrentGroup: true, forCurrentUser: true }) | ||
const canAdmin = hasResponsibility(RESP_ADMINISTRATION) | ||
|
||
useEffect(() => { | ||
/* | ||
TODO: Web has a bunch of code that checks the color of the group background | ||
image to select a good constrasting color for the text. | ||
|
||
Its very dependent on the DOM, so need to consider a different option for mobile | ||
*/ | ||
setTextColor('primary-foreground') | ||
}, [bannerUrl]) | ||
|
||
return ( | ||
<View className='relative flex flex-col justify-end h-[140px] shadow-md pb-2' testID='group-header'> | ||
<FastImage | ||
source={{ uri: bannerUrl }} | ||
style={{ | ||
height: 146, | ||
width: '100%', | ||
position: 'absolute', | ||
opacity: 0.8, | ||
}} | ||
/> | ||
|
||
{canAdmin && ( | ||
<View className='absolute top-2 right-2'> | ||
<TouchableOpacity | ||
// TODO redesign: make this actually navigate correctly | ||
onPress={() => navigation.navigate('Group Settings')} | ||
> | ||
<View className='w-6 h-6 drop-shadow-md'> | ||
<Settings color='white' size={24}/> | ||
</View> | ||
</TouchableOpacity> | ||
</View> | ||
)} | ||
|
||
<View className='relative flex flex-row items-center text-background ml-2 mr-2 gap-1'> | ||
<FastImage | ||
source={{ uri: avatarUrl }} | ||
style={{ | ||
height: 36, | ||
width: 36, | ||
marginRight: 6, | ||
borderRadius: 4 | ||
}} | ||
/> | ||
|
||
<View className={cn( | ||
'flex flex-col flex-1', | ||
`text-${textColor} drop-shadow-md` | ||
)}> | ||
<Text className='text-xl font-bold m-0 text-white'> | ||
{group.name} | ||
</Text> | ||
|
||
<TouchableOpacity | ||
onPress={() => navigation.navigate('Members', { groupSlug: group.slug })} | ||
className='flex-row items-center' | ||
> | ||
<View className='w-4 h-4 mr-1 align-bottom' > | ||
<Users color='white' size={16} /> | ||
</View> | ||
<Text className='text-xs align-middle text-white underline'> | ||
{t('{{count}} Members', { count: group.memberCount })} | ||
</Text> | ||
</TouchableOpacity> | ||
</View> | ||
|
||
<TouchableOpacity | ||
onPress={() => navigation.navigate('About', { groupSlug: group.slug })} | ||
hitSlop={6} | ||
> | ||
<View className='cursor-pointer'> | ||
<ChevronRight color='white' size={24} strokeWidth={3}/> | ||
</View> | ||
</TouchableOpacity> | ||
</View> | ||
</View> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import component from './GroupMenuHeader' | ||
|
||
export default component |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove