theme entire profile
This commit is contained in:
@@ -76,7 +76,7 @@ export function MessageProfileButton({
|
|||||||
accessibilityRole="button"
|
accessibilityRole="button"
|
||||||
testID="dmBtn"
|
testID="dmBtn"
|
||||||
size="small"
|
size="small"
|
||||||
color="secondary"
|
color="secondary_inverted"
|
||||||
variant="solid"
|
variant="solid"
|
||||||
shape="round"
|
shape="round"
|
||||||
label={_(msg`Message ${profile.handle}`)}
|
label={_(msg`Message ${profile.handle}`)}
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ let ProfileHeaderStandard = ({
|
|||||||
<Button
|
<Button
|
||||||
testID="profileHeaderEditProfileButton"
|
testID="profileHeaderEditProfileButton"
|
||||||
size="small"
|
size="small"
|
||||||
color="secondary"
|
color="secondary_inverted"
|
||||||
variant="solid"
|
variant="solid"
|
||||||
onPress={onPressEditProfile}
|
onPress={onPressEditProfile}
|
||||||
label={_(msg`Edit profile`)}>
|
label={_(msg`Edit profile`)}>
|
||||||
@@ -212,7 +212,9 @@ let ProfileHeaderStandard = ({
|
|||||||
<Button
|
<Button
|
||||||
testID={profile.viewer?.following ? 'unfollowBtn' : 'followBtn'}
|
testID={profile.viewer?.following ? 'unfollowBtn' : 'followBtn'}
|
||||||
size="small"
|
size="small"
|
||||||
color={profile.viewer?.following ? 'secondary' : 'primary'}
|
color={
|
||||||
|
profile.viewer?.following ? 'secondary_inverted' : 'primary'
|
||||||
|
}
|
||||||
variant="solid"
|
variant="solid"
|
||||||
label={
|
label={
|
||||||
profile.viewer?.following
|
profile.viewer?.following
|
||||||
@@ -257,7 +259,6 @@ let ProfileHeaderStandard = ({
|
|||||||
value={descriptionRT}
|
value={descriptionRT}
|
||||||
enableTags
|
enableTags
|
||||||
authorHandle={profile.handle}
|
authorHandle={profile.handle}
|
||||||
dynamicColor
|
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
) : undefined}
|
) : undefined}
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ let ProfileMenu = ({
|
|||||||
label={_(msg`More options`)}
|
label={_(msg`More options`)}
|
||||||
hitSlop={HITSLOP_20}
|
hitSlop={HITSLOP_20}
|
||||||
variant="solid"
|
variant="solid"
|
||||||
color="secondary"
|
color="secondary_inverted"
|
||||||
size="small"
|
size="small"
|
||||||
shape="round">
|
shape="round">
|
||||||
<ButtonIcon icon={Ellipsis} size="sm" />
|
<ButtonIcon icon={Ellipsis} size="sm" />
|
||||||
|
|||||||
+148
-154
@@ -345,14 +345,8 @@ function ProfileScreenLoaded({
|
|||||||
const [hue, setHue] = React.useState(0)
|
const [hue, setHue] = React.useState(0)
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
const id = setInterval(() => {
|
const id = setInterval(() => {
|
||||||
setHue(h => {
|
setHue(Math.random() * 360)
|
||||||
const next = h + 1
|
}, 5000)
|
||||||
if (next >= 360) {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
return next
|
|
||||||
})
|
|
||||||
}, 100)
|
|
||||||
return () => clearInterval(id)
|
return () => clearInterval(id)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
@@ -369,17 +363,15 @@ function ProfileScreenLoaded({
|
|||||||
const renderHeader = () => {
|
const renderHeader = () => {
|
||||||
return (
|
return (
|
||||||
<ExpoScrollForwarderView scrollViewTag={scrollViewTag}>
|
<ExpoScrollForwarderView scrollViewTag={scrollViewTag}>
|
||||||
<Alf themeName={t.name} theme={theme}>
|
<ProfileHeader
|
||||||
<ProfileHeader
|
profile={profile}
|
||||||
profile={profile}
|
labeler={labelerInfo}
|
||||||
labeler={labelerInfo}
|
descriptionRT={hasDescription ? descriptionRT : null}
|
||||||
descriptionRT={hasDescription ? descriptionRT : null}
|
moderationOpts={moderationOpts}
|
||||||
moderationOpts={moderationOpts}
|
hideBackButton={hideBackButton}
|
||||||
hideBackButton={hideBackButton}
|
isPlaceholderProfile={showPlaceholder}
|
||||||
isPlaceholderProfile={showPlaceholder}
|
backgroundColor={t.atoms.bg.backgroundColor}
|
||||||
backgroundColor={t.atoms.bg.backgroundColor}
|
/>
|
||||||
/>
|
|
||||||
</Alf>
|
|
||||||
</ExpoScrollForwarderView>
|
</ExpoScrollForwarderView>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -390,141 +382,143 @@ function ProfileScreenLoaded({
|
|||||||
style={styles.container}
|
style={styles.container}
|
||||||
screenDescription={_(msg`profile`)}
|
screenDescription={_(msg`profile`)}
|
||||||
modui={moderation.ui('profileView')}>
|
modui={moderation.ui('profileView')}>
|
||||||
<PagerWithHeader
|
<Alf themeName={t.name} theme={theme}>
|
||||||
testID="profilePager"
|
<PagerWithHeader
|
||||||
isHeaderReady={!showPlaceholder}
|
testID="profilePager"
|
||||||
items={sectionTitles}
|
isHeaderReady={!showPlaceholder}
|
||||||
onPageSelected={onPageSelected}
|
items={sectionTitles}
|
||||||
onCurrentPageSelected={onCurrentPageSelected}
|
onPageSelected={onPageSelected}
|
||||||
renderHeader={renderHeader}
|
onCurrentPageSelected={onCurrentPageSelected}
|
||||||
allowHeaderOverScroll>
|
renderHeader={renderHeader}
|
||||||
{showFiltersTab
|
allowHeaderOverScroll>
|
||||||
? ({headerHeight, isFocused, scrollElRef}) => (
|
{showFiltersTab
|
||||||
<ProfileLabelsSection
|
? ({headerHeight, isFocused, scrollElRef}) => (
|
||||||
ref={labelsSectionRef}
|
<ProfileLabelsSection
|
||||||
labelerInfo={labelerInfo}
|
ref={labelsSectionRef}
|
||||||
labelerError={labelerError}
|
labelerInfo={labelerInfo}
|
||||||
isLabelerLoading={isLabelerLoading}
|
labelerError={labelerError}
|
||||||
moderationOpts={moderationOpts}
|
isLabelerLoading={isLabelerLoading}
|
||||||
scrollElRef={scrollElRef as ListRef}
|
moderationOpts={moderationOpts}
|
||||||
headerHeight={headerHeight}
|
scrollElRef={scrollElRef as ListRef}
|
||||||
isFocused={isFocused}
|
headerHeight={headerHeight}
|
||||||
setScrollViewTag={setScrollViewTag}
|
isFocused={isFocused}
|
||||||
/>
|
setScrollViewTag={setScrollViewTag}
|
||||||
)
|
/>
|
||||||
: null}
|
)
|
||||||
{showListsTab && !!profile.associated?.labeler
|
: null}
|
||||||
? ({headerHeight, isFocused, scrollElRef}) => (
|
{showListsTab && !!profile.associated?.labeler
|
||||||
<ProfileLists
|
? ({headerHeight, isFocused, scrollElRef}) => (
|
||||||
ref={listsSectionRef}
|
<ProfileLists
|
||||||
did={profile.did}
|
ref={listsSectionRef}
|
||||||
scrollElRef={scrollElRef as ListRef}
|
did={profile.did}
|
||||||
headerOffset={headerHeight}
|
scrollElRef={scrollElRef as ListRef}
|
||||||
enabled={isFocused}
|
headerOffset={headerHeight}
|
||||||
setScrollViewTag={setScrollViewTag}
|
enabled={isFocused}
|
||||||
/>
|
setScrollViewTag={setScrollViewTag}
|
||||||
)
|
/>
|
||||||
: null}
|
)
|
||||||
{showPostsTab
|
: null}
|
||||||
? ({headerHeight, isFocused, scrollElRef}) => (
|
{showPostsTab
|
||||||
<ProfileFeedSection
|
? ({headerHeight, isFocused, scrollElRef}) => (
|
||||||
ref={postsSectionRef}
|
<ProfileFeedSection
|
||||||
feed={`author|${profile.did}|posts_and_author_threads`}
|
ref={postsSectionRef}
|
||||||
headerHeight={headerHeight}
|
feed={`author|${profile.did}|posts_and_author_threads`}
|
||||||
isFocused={isFocused}
|
headerHeight={headerHeight}
|
||||||
scrollElRef={scrollElRef as ListRef}
|
isFocused={isFocused}
|
||||||
ignoreFilterFor={profile.did}
|
scrollElRef={scrollElRef as ListRef}
|
||||||
setScrollViewTag={setScrollViewTag}
|
ignoreFilterFor={profile.did}
|
||||||
/>
|
setScrollViewTag={setScrollViewTag}
|
||||||
)
|
/>
|
||||||
: null}
|
)
|
||||||
{showRepliesTab
|
: null}
|
||||||
? ({headerHeight, isFocused, scrollElRef}) => (
|
{showRepliesTab
|
||||||
<ProfileFeedSection
|
? ({headerHeight, isFocused, scrollElRef}) => (
|
||||||
ref={repliesSectionRef}
|
<ProfileFeedSection
|
||||||
feed={`author|${profile.did}|posts_with_replies`}
|
ref={repliesSectionRef}
|
||||||
headerHeight={headerHeight}
|
feed={`author|${profile.did}|posts_with_replies`}
|
||||||
isFocused={isFocused}
|
headerHeight={headerHeight}
|
||||||
scrollElRef={scrollElRef as ListRef}
|
isFocused={isFocused}
|
||||||
ignoreFilterFor={profile.did}
|
scrollElRef={scrollElRef as ListRef}
|
||||||
setScrollViewTag={setScrollViewTag}
|
ignoreFilterFor={profile.did}
|
||||||
/>
|
setScrollViewTag={setScrollViewTag}
|
||||||
)
|
/>
|
||||||
: null}
|
)
|
||||||
{showMediaTab
|
: null}
|
||||||
? ({headerHeight, isFocused, scrollElRef}) => (
|
{showMediaTab
|
||||||
<ProfileFeedSection
|
? ({headerHeight, isFocused, scrollElRef}) => (
|
||||||
ref={mediaSectionRef}
|
<ProfileFeedSection
|
||||||
feed={`author|${profile.did}|posts_with_media`}
|
ref={mediaSectionRef}
|
||||||
headerHeight={headerHeight}
|
feed={`author|${profile.did}|posts_with_media`}
|
||||||
isFocused={isFocused}
|
headerHeight={headerHeight}
|
||||||
scrollElRef={scrollElRef as ListRef}
|
isFocused={isFocused}
|
||||||
ignoreFilterFor={profile.did}
|
scrollElRef={scrollElRef as ListRef}
|
||||||
setScrollViewTag={setScrollViewTag}
|
ignoreFilterFor={profile.did}
|
||||||
/>
|
setScrollViewTag={setScrollViewTag}
|
||||||
)
|
/>
|
||||||
: null}
|
)
|
||||||
{showLikesTab
|
: null}
|
||||||
? ({headerHeight, isFocused, scrollElRef}) => (
|
{showLikesTab
|
||||||
<ProfileFeedSection
|
? ({headerHeight, isFocused, scrollElRef}) => (
|
||||||
ref={likesSectionRef}
|
<ProfileFeedSection
|
||||||
feed={`likes|${profile.did}`}
|
ref={likesSectionRef}
|
||||||
headerHeight={headerHeight}
|
feed={`likes|${profile.did}`}
|
||||||
isFocused={isFocused}
|
headerHeight={headerHeight}
|
||||||
scrollElRef={scrollElRef as ListRef}
|
isFocused={isFocused}
|
||||||
ignoreFilterFor={profile.did}
|
scrollElRef={scrollElRef as ListRef}
|
||||||
setScrollViewTag={setScrollViewTag}
|
ignoreFilterFor={profile.did}
|
||||||
/>
|
setScrollViewTag={setScrollViewTag}
|
||||||
)
|
/>
|
||||||
: null}
|
)
|
||||||
{showFeedsTab
|
: null}
|
||||||
? ({headerHeight, isFocused, scrollElRef}) => (
|
{showFeedsTab
|
||||||
<ProfileFeedgens
|
? ({headerHeight, isFocused, scrollElRef}) => (
|
||||||
ref={feedsSectionRef}
|
<ProfileFeedgens
|
||||||
did={profile.did}
|
ref={feedsSectionRef}
|
||||||
scrollElRef={scrollElRef as ListRef}
|
did={profile.did}
|
||||||
headerOffset={headerHeight}
|
scrollElRef={scrollElRef as ListRef}
|
||||||
enabled={isFocused}
|
headerOffset={headerHeight}
|
||||||
setScrollViewTag={setScrollViewTag}
|
enabled={isFocused}
|
||||||
/>
|
setScrollViewTag={setScrollViewTag}
|
||||||
)
|
/>
|
||||||
: null}
|
)
|
||||||
{showStarterPacksTab
|
: null}
|
||||||
? ({headerHeight, isFocused, scrollElRef}) => (
|
{showStarterPacksTab
|
||||||
<ProfileStarterPacks
|
? ({headerHeight, isFocused, scrollElRef}) => (
|
||||||
ref={starterPacksSectionRef}
|
<ProfileStarterPacks
|
||||||
isMe={isMe}
|
ref={starterPacksSectionRef}
|
||||||
starterPacksQuery={starterPacksQuery}
|
isMe={isMe}
|
||||||
scrollElRef={scrollElRef as ListRef}
|
starterPacksQuery={starterPacksQuery}
|
||||||
headerOffset={headerHeight}
|
scrollElRef={scrollElRef as ListRef}
|
||||||
enabled={isFocused}
|
headerOffset={headerHeight}
|
||||||
setScrollViewTag={setScrollViewTag}
|
enabled={isFocused}
|
||||||
/>
|
setScrollViewTag={setScrollViewTag}
|
||||||
)
|
/>
|
||||||
: null}
|
)
|
||||||
{showListsTab && !profile.associated?.labeler
|
: null}
|
||||||
? ({headerHeight, isFocused, scrollElRef}) => (
|
{showListsTab && !profile.associated?.labeler
|
||||||
<ProfileLists
|
? ({headerHeight, isFocused, scrollElRef}) => (
|
||||||
ref={listsSectionRef}
|
<ProfileLists
|
||||||
did={profile.did}
|
ref={listsSectionRef}
|
||||||
scrollElRef={scrollElRef as ListRef}
|
did={profile.did}
|
||||||
headerOffset={headerHeight}
|
scrollElRef={scrollElRef as ListRef}
|
||||||
enabled={isFocused}
|
headerOffset={headerHeight}
|
||||||
setScrollViewTag={setScrollViewTag}
|
enabled={isFocused}
|
||||||
/>
|
setScrollViewTag={setScrollViewTag}
|
||||||
)
|
/>
|
||||||
: null}
|
)
|
||||||
</PagerWithHeader>
|
: null}
|
||||||
{hasSession && (
|
</PagerWithHeader>
|
||||||
<FAB
|
{hasSession && (
|
||||||
testID="composeFAB"
|
<FAB
|
||||||
onPress={onPressCompose}
|
testID="composeFAB"
|
||||||
icon={<ComposeIcon2 strokeWidth={1.5} size={29} style={s.white} />}
|
onPress={onPressCompose}
|
||||||
accessibilityRole="button"
|
icon={<ComposeIcon2 strokeWidth={1.5} size={29} style={s.white} />}
|
||||||
accessibilityLabel={_(msg`New post`)}
|
accessibilityRole="button"
|
||||||
accessibilityHint=""
|
accessibilityLabel={_(msg`New post`)}
|
||||||
/>
|
accessibilityHint=""
|
||||||
)}
|
/>
|
||||||
|
)}
|
||||||
|
</Alf>
|
||||||
</ScreenHider>
|
</ScreenHider>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user