mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Post controls update followup (#4276)

* rm legacy repost modal

* make repost button transparent

* reduce gap between post and ctrls

* remove old repost modal on web

authored by samuel.fm and committed by

GitHub d92036f2 c4abaa1a

+17 -148
+7
src/alf/atoms.ts
··· 56 56 }), 57 57 58 58 /* 59 + * Theme-independent bg colors 60 + */ 61 + bg_transparent: { 62 + backgroundColor: 'transparent', 63 + }, 64 + 65 + /* 59 66 * Border radius 60 67 */ 61 68 rounded_2xs: {
+1 -1
src/components/Button.tsx
··· 376 376 a.align_center, 377 377 a.justify_center, 378 378 flattenedBaseStyles, 379 + flatten(style), 379 380 ...(state.hovered || state.pressed 380 381 ? [hoverStyles, flatten(hoverStyleProp)] 381 382 : []), 382 - flatten(style), 383 383 ]} 384 384 onPressIn={onPressIn} 385 385 onPressOut={onPressOut}
-8
src/state/modals/index.tsx
··· 60 60 name: 'delete-account' 61 61 } 62 62 63 - export interface RepostModal { 64 - name: 'repost' 65 - onRepost: () => void 66 - onQuote: () => void 67 - isReposted: boolean 68 - } 69 - 70 63 export interface SelfLabelModal { 71 64 name: 'self-label' 72 65 labels: string[] ··· 154 147 | AltTextImageModal 155 148 | CropImageModal 156 149 | EditImageModal 157 - | RepostModal 158 150 | SelfLabelModal 159 151 | ThreadgateModal 160 152
-4
src/view/com/modals/Modal.tsx
··· 22 22 import * as PostLanguagesSettingsModal from './lang-settings/PostLanguagesSettings' 23 23 import * as LinkWarningModal from './LinkWarning' 24 24 import * as ListAddUserModal from './ListAddRemoveUsers' 25 - import * as RepostModal from './Repost' 26 25 import * as SelfLabelModal from './SelfLabel' 27 26 import * as ThreadgateModal from './Threadgate' 28 27 import * as UserAddRemoveListsModal from './UserAddRemoveLists' ··· 74 73 } else if (activeModal?.name === 'delete-account') { 75 74 snapPoints = DeleteAccountModal.snapPoints 76 75 element = <DeleteAccountModal.Component /> 77 - } else if (activeModal?.name === 'repost') { 78 - snapPoints = RepostModal.snapPoints 79 - element = <RepostModal.Component {...activeModal} /> 80 76 } else if (activeModal?.name === 'self-label') { 81 77 snapPoints = SelfLabelModal.snapPoints 82 78 element = <SelfLabelModal.Component {...activeModal} />
-3
src/view/com/modals/Modal.web.tsx
··· 22 22 import * as PostLanguagesSettingsModal from './lang-settings/PostLanguagesSettings' 23 23 import * as LinkWarningModal from './LinkWarning' 24 24 import * as ListAddUserModal from './ListAddRemoveUsers' 25 - import * as RepostModal from './Repost' 26 25 import * as SelfLabelModal from './SelfLabel' 27 26 import * as ThreadgateModal from './Threadgate' 28 27 import * as UserAddRemoveLists from './UserAddRemoveLists' ··· 83 82 element = <CropImageModal.Component {...modal} /> 84 83 } else if (modal.name === 'delete-account') { 85 84 element = <DeleteAccountModal.Component /> 86 - } else if (modal.name === 'repost') { 87 - element = <RepostModal.Component {...modal} /> 88 85 } else if (modal.name === 'self-label') { 89 86 element = <SelfLabelModal.Component {...modal} /> 90 87 } else if (modal.name === 'threadgate') {
-129
src/view/com/modals/Repost.tsx
··· 1 - import React from 'react' 2 - import {StyleSheet, TouchableOpacity, View} from 'react-native' 3 - import {LinearGradient} from 'expo-linear-gradient' 4 - import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' 5 - import {msg, Trans} from '@lingui/macro' 6 - import {useLingui} from '@lingui/react' 7 - 8 - import {useModalControls} from '#/state/modals' 9 - import {usePalette} from 'lib/hooks/usePalette' 10 - import {RepostIcon} from 'lib/icons' 11 - import {colors, gradients, s} from 'lib/styles' 12 - import {Text} from '../util/text/Text' 13 - 14 - export const snapPoints = [250] 15 - 16 - export function Component({ 17 - onRepost, 18 - onQuote, 19 - isReposted, 20 - }: { 21 - onRepost: () => void 22 - onQuote: () => void 23 - isReposted: boolean 24 - // TODO: Add author into component 25 - }) { 26 - const pal = usePalette('default') 27 - const {_} = useLingui() 28 - const {closeModal} = useModalControls() 29 - const onPress = async () => { 30 - closeModal() 31 - } 32 - 33 - return ( 34 - <View testID="repostModal" style={[s.flex1, pal.view, styles.container]}> 35 - <View style={s.pb20}> 36 - <TouchableOpacity 37 - testID="repostBtn" 38 - style={[styles.actionBtn]} 39 - onPress={onRepost} 40 - accessibilityRole="button" 41 - accessibilityLabel={ 42 - isReposted 43 - ? _(msg`Undo repost`) 44 - : _(msg({message: `Repost`, context: 'action'})) 45 - } 46 - accessibilityHint={ 47 - isReposted 48 - ? _(msg`Remove repost`) 49 - : _(msg({message: `Repost`, context: 'action'})) 50 - }> 51 - <RepostIcon strokeWidth={2} size={24} style={s.blue3} /> 52 - <Text type="title-lg" style={[styles.actionBtnLabel, pal.text]}> 53 - {!isReposted ? ( 54 - <Trans context="action">Repost</Trans> 55 - ) : ( 56 - <Trans>Undo repost</Trans> 57 - )} 58 - </Text> 59 - </TouchableOpacity> 60 - <TouchableOpacity 61 - testID="quoteBtn" 62 - style={[styles.actionBtn]} 63 - onPress={onQuote} 64 - accessibilityRole="button" 65 - accessibilityLabel={_( 66 - msg({message: `Quote post`, context: 'action'}), 67 - )} 68 - accessibilityHint=""> 69 - <FontAwesomeIcon icon="quote-left" size={24} style={s.blue3} /> 70 - <Text type="title-lg" style={[styles.actionBtnLabel, pal.text]}> 71 - <Trans context="action">Quote Post</Trans> 72 - </Text> 73 - </TouchableOpacity> 74 - </View> 75 - <TouchableOpacity 76 - testID="cancelBtn" 77 - onPress={onPress} 78 - accessibilityRole="button" 79 - accessibilityLabel={_(msg`Cancel quote post`)} 80 - accessibilityHint="" 81 - onAccessibilityEscape={onPress}> 82 - <LinearGradient 83 - colors={[gradients.blueLight.start, gradients.blueLight.end]} 84 - start={{x: 0, y: 0}} 85 - end={{x: 1, y: 1}} 86 - style={[styles.btn]}> 87 - <Text style={[s.white, s.bold, s.f18]}> 88 - <Trans>Cancel</Trans> 89 - </Text> 90 - </LinearGradient> 91 - </TouchableOpacity> 92 - </View> 93 - ) 94 - } 95 - 96 - const styles = StyleSheet.create({ 97 - container: { 98 - paddingHorizontal: 30, 99 - }, 100 - title: { 101 - textAlign: 'center', 102 - fontWeight: 'bold', 103 - fontSize: 24, 104 - marginBottom: 12, 105 - }, 106 - description: { 107 - textAlign: 'center', 108 - fontSize: 17, 109 - paddingHorizontal: 22, 110 - marginBottom: 10, 111 - }, 112 - btn: { 113 - flexDirection: 'row', 114 - alignItems: 'center', 115 - justifyContent: 'center', 116 - width: '100%', 117 - borderRadius: 32, 118 - padding: 14, 119 - backgroundColor: colors.gray1, 120 - }, 121 - actionBtn: { 122 - flexDirection: 'row', 123 - alignItems: 'center', 124 - }, 125 - actionBtnLabel: { 126 - paddingHorizontal: 14, 127 - paddingVertical: 16, 128 - }, 129 - })
+2 -2
src/view/com/posts/FeedItem.tsx
··· 390 390 /> 391 391 ) : undefined} 392 392 {postEmbed ? ( 393 - <View style={[a.pb_sm]}> 393 + <View style={[a.pb_xs]}> 394 394 <PostEmbeds 395 395 embed={postEmbed} 396 396 moderation={moderation} ··· 482 482 flexDirection: 'row', 483 483 alignItems: 'center', 484 484 flexWrap: 'wrap', 485 - paddingBottom: 4, 485 + paddingBottom: 2, 486 486 }, 487 487 contentHiderChild: { 488 488 marginTop: 6,
+7 -1
src/view/com/util/post-ctrls/RepostButton.tsx
··· 47 47 onPress={() => { 48 48 requireAuth(() => dialogControl.open()) 49 49 }} 50 - style={[a.flex_row, a.align_center, a.gap_xs, {padding: 5}]} 50 + style={[ 51 + a.flex_row, 52 + a.align_center, 53 + a.gap_xs, 54 + a.bg_transparent, 55 + {padding: 5}, 56 + ]} 51 57 hoverStyle={t.atoms.bg_contrast_25} 52 58 label={`${ 53 59 isReposted