-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2715 from ecency/mb/theme-container
Mb/theme container
- Loading branch information
Showing
17 changed files
with
429 additions
and
484 deletions.
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
45 changes: 20 additions & 25 deletions
45
src/components/basicUIElements/view/placeHolder/postCardPlaceHolderView.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 |
---|---|---|
@@ -1,39 +1,34 @@ | ||
import React from 'react'; | ||
import { View } from 'react-native'; | ||
import LottieView from 'lottie-react-native'; | ||
import { ThemeContainer } from '../../../../containers'; | ||
import { useSelector } from 'react-redux'; | ||
import styles from './postCardPlaceHolderStyles'; | ||
import getWindowDimensions from '../../../../utils/getWindowDimensions'; | ||
|
||
const PostCardPlaceHolder = () => { | ||
const animationStyle = { | ||
width: getWindowDimensions().nativeWidth - 32, | ||
}; | ||
|
||
const isDarkTheme = useSelector((state) => state.application.isDarkTheme); | ||
const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; | ||
return ( | ||
<ThemeContainer> | ||
{({ isDarkTheme }) => { | ||
const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; | ||
return ( | ||
<View style={styles.container}> | ||
<LottieView | ||
style={animationStyle} | ||
source={require('../../../../assets/animations/postList.json')} | ||
autoPlay | ||
loop={true} | ||
autoSize={true} | ||
resizeMode="cover" | ||
colorFilters={[ | ||
{ | ||
keypath: 'postList', | ||
color, | ||
}, | ||
]} | ||
/> | ||
</View> | ||
); | ||
}} | ||
</ThemeContainer> | ||
<View style={styles.container}> | ||
<LottieView | ||
style={animationStyle} | ||
source={require('../../../../assets/animations/postList.json')} | ||
autoPlay | ||
loop={true} | ||
autoSize={true} | ||
resizeMode="cover" | ||
colorFilters={[ | ||
{ | ||
keypath: 'postList', | ||
color, | ||
}, | ||
]} | ||
/> | ||
</View> | ||
); | ||
|
||
}; | ||
export default PostCardPlaceHolder; |
49 changes: 23 additions & 26 deletions
49
src/components/basicUIElements/view/placeHolder/postPlaceHolderView.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 |
---|---|---|
@@ -1,36 +1,33 @@ | ||
import React from 'react'; | ||
import { View } from 'react-native'; | ||
import LottieView from 'lottie-react-native'; | ||
import { ThemeContainer } from '../../../../containers'; | ||
import getWindowDimensions from '../../../../utils/getWindowDimensions'; | ||
import { useSelector } from 'react-redux'; | ||
|
||
import getWindowDimensions from '../../../../utils/getWindowDimensions'; | ||
const PostPlaceHolder = () => { | ||
return ( | ||
<ThemeContainer> | ||
{({ isDarkTheme }) => { | ||
const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; | ||
|
||
return ( | ||
<View> | ||
<LottieView | ||
style={{ width: getWindowDimensions().nativeWidth - 24 }} | ||
source={require('../../../../assets/animations/postBody.json')} | ||
autoPlay | ||
loop={true} | ||
autoSize={true} | ||
resizeMode="cover" | ||
colorFilters={[ | ||
{ | ||
keypath: 'layer1', | ||
color, | ||
}, | ||
]} | ||
/> | ||
</View> | ||
); | ||
}} | ||
</ThemeContainer> | ||
const isDarkTheme = useSelector((state) => state.application.isDarkTheme); | ||
const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; | ||
|
||
return ( | ||
<View> | ||
<LottieView | ||
style={{ width: getWindowDimensions().nativeWidth - 24 }} | ||
source={require('../../../../assets/animations/postBody.json')} | ||
autoPlay | ||
loop={true} | ||
autoSize={true} | ||
resizeMode="cover" | ||
colorFilters={[ | ||
{ | ||
keypath: 'layer1', | ||
color, | ||
}, | ||
]} | ||
/> | ||
</View> | ||
); | ||
|
||
}; | ||
|
||
export default PostPlaceHolder; |
Oops, something went wrong.