mirror of
https://github.com/lemeow125/StudE-Frontend.git
synced 2024-11-17 06:19:25 +08:00
Polished animated container and homepage
This commit is contained in:
parent
8ffb359604
commit
96df2f2f05
3 changed files with 31 additions and 19 deletions
|
@ -9,22 +9,34 @@ export interface props {
|
|||
|
||||
export default function AnimatedContainer(props: props) {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<MotiScrollView
|
||||
from={{
|
||||
opacity: 0,
|
||||
backgroundColor: colors.orange_1,
|
||||
flex: 1,
|
||||
}}
|
||||
animate={{
|
||||
opacity: 1,
|
||||
backgroundColor: colors.blue_2,
|
||||
flex: 1,
|
||||
}}
|
||||
transition={{ type: "timing", duration: 300 }}
|
||||
>
|
||||
{props.children}
|
||||
</MotiScrollView>
|
||||
</View>
|
||||
<MotiScrollView
|
||||
contentContainerStyle={{
|
||||
alignItems: "center",
|
||||
alignSelf: "center",
|
||||
justifyContent: "flex-start",
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
flex: 1,
|
||||
}}
|
||||
from={{
|
||||
borderRadius: 0,
|
||||
backgroundColor: colors.orange_2,
|
||||
paddingTop: 4,
|
||||
paddingBottom: 4,
|
||||
marginHorizontal: "4%",
|
||||
marginVertical: "5%",
|
||||
}}
|
||||
animate={{
|
||||
borderRadius: 15,
|
||||
backgroundColor: colors.blue_2,
|
||||
paddingTop: 16,
|
||||
paddingBottom: 16,
|
||||
marginHorizontal: "4%",
|
||||
marginVertical: "5%",
|
||||
}}
|
||||
transition={{ type: "timing", duration: 300 }}
|
||||
>
|
||||
{props.children}
|
||||
</MotiScrollView>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ export default function Home() {
|
|||
};
|
||||
function CustomMap() {
|
||||
if (dist !== null && location !== null) {
|
||||
if (dist <= 1) {
|
||||
if (dist >= 1) {
|
||||
// Just switch this condition for map debugging
|
||||
return <MapView style={styles.map} initialRegion={ustpCoords} />;
|
||||
} else {
|
||||
|
|
|
@ -39,7 +39,7 @@ const styles = StyleSheet.create({
|
|||
marginVertical: "5%",
|
||||
width: "92%",
|
||||
borderRadius: 15,
|
||||
backgroundColor: colors.blue_2,
|
||||
// backgroundColor: colors.blue_2,
|
||||
alignItems: "center",
|
||||
alignSelf: "center",
|
||||
paddingTop: 32,
|
||||
|
|
Loading…
Reference in a new issue