-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Implement discipline tasks (#145)
- Loading branch information
Showing
53 changed files
with
2,656 additions
and
450 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,34 @@ | ||
import React from 'react'; | ||
import AutoHeightWebView from 'react-native-autoheight-webview'; | ||
import Popover, { PopoverPlacement } from 'react-native-popover-view'; | ||
|
||
import { useGlobalStyles } from '../hooks'; | ||
import { useAppTheme } from '../hooks/theme'; | ||
import { getStyles } from '../utils/webView'; | ||
import { Button } from './Button'; | ||
|
||
const AnnouncePopover = ({ data }: { data: string }) => { | ||
const globalStyles = useGlobalStyles(); | ||
const theme = useAppTheme(); | ||
|
||
return ( | ||
<Popover | ||
placement={PopoverPlacement.FLOATING} | ||
from={(_, showPopover) => ( | ||
<Button text={'Объявление'} onPress={showPopover} variant={'card'} /> | ||
)} | ||
popoverStyle={{ | ||
borderRadius: globalStyles.border.borderRadius, | ||
backgroundColor: globalStyles.block.backgroundColor, | ||
padding: '2%', | ||
}} | ||
> | ||
<AutoHeightWebView | ||
source={{ html: data }} | ||
customStyle={getStyles(theme.colors.textForBlock, theme.colors.primary)} | ||
/> | ||
</Popover> | ||
); | ||
}; | ||
|
||
export default AnnouncePopover; |
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,24 @@ | ||
import { BottomSheetBackdropProps } from '@gorhom/bottom-sheet'; | ||
import React, { useMemo } from 'react'; | ||
import Animated, { Extrapolation, interpolate, useAnimatedStyle } from 'react-native-reanimated'; | ||
|
||
const BottomSheetModalBackdrop = ({ animatedIndex, style }: BottomSheetBackdropProps) => { | ||
const containerAnimatedStyle = useAnimatedStyle(() => ({ | ||
opacity: interpolate(animatedIndex.value, [-1, 0], [0, 0.3], Extrapolation.CLAMP), | ||
})); | ||
|
||
const containerStyle = useMemo( | ||
() => [ | ||
style, | ||
{ | ||
backgroundColor: '#000000', | ||
}, | ||
containerAnimatedStyle, | ||
], | ||
[style, containerAnimatedStyle] | ||
); | ||
|
||
return <Animated.View style={containerStyle} />; | ||
}; | ||
|
||
export default BottomSheetModalBackdrop; |
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 |
---|---|---|
@@ -1,30 +1,58 @@ | ||
import React from 'react'; | ||
import { StyleProp, TextStyle, TouchableOpacity, ViewStyle } from 'react-native'; | ||
import { | ||
StyleProp, | ||
StyleSheet, | ||
TextStyle, | ||
TouchableOpacity, | ||
TouchableOpacityProps, | ||
ViewStyle, | ||
} from 'react-native'; | ||
|
||
import Text, { TextColorVariant } from './Text'; | ||
|
||
interface ClickableTextProps { | ||
interface ClickableTextProps extends TouchableOpacityProps { | ||
text: string | number; | ||
textStyle?: StyleProp<TextStyle>; | ||
viewStyle?: StyleProp<ViewStyle>; | ||
onPress(): void; | ||
adjustsFontSizeToFit?: boolean; | ||
colorVariant?: TextColorVariant; | ||
iconLeft?: React.ReactNode; | ||
iconRight?: React.ReactNode; | ||
} | ||
|
||
const ClickableText = ({ | ||
text, | ||
textStyle, | ||
viewStyle, | ||
onPress, | ||
adjustsFontSizeToFit, | ||
colorVariant, | ||
}: ClickableTextProps) => ( | ||
<TouchableOpacity style={viewStyle} onPress={onPress}> | ||
<Text adjustsFontSizeToFit={adjustsFontSizeToFit} style={textStyle} colorVariant={colorVariant}> | ||
{text} | ||
</Text> | ||
</TouchableOpacity> | ||
const ClickableText = React.forwardRef<TouchableOpacity, ClickableTextProps>( | ||
( | ||
{ | ||
text, | ||
textStyle, | ||
viewStyle, | ||
adjustsFontSizeToFit, | ||
colorVariant, | ||
iconLeft, | ||
iconRight, | ||
...props | ||
}, | ||
ref | ||
) => ( | ||
<TouchableOpacity style={[styles.row, viewStyle]} ref={ref} {...props}> | ||
{iconLeft} | ||
<Text | ||
adjustsFontSizeToFit={adjustsFontSizeToFit} | ||
style={textStyle} | ||
colorVariant={colorVariant} | ||
> | ||
{text} | ||
</Text> | ||
{iconRight} | ||
</TouchableOpacity> | ||
) | ||
); | ||
|
||
export default ClickableText; | ||
|
||
const styles = StyleSheet.create({ | ||
row: { | ||
flexDirection: 'row', | ||
}, | ||
}); |
Oops, something went wrong.