Skip to content

Commit

Permalink
put restart drill button stuck at the bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankreedX committed Mar 14, 2024
1 parent 4dd992e commit fe5f5c7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 31 deletions.
4 changes: 2 additions & 2 deletions app/content/drill/[id]/description.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import {
import { Button, Text } from "react-native-paper";
import Carousel from "react-native-reanimated-carousel";

import ErrorComponent from "~/components/errorComponent";
import Loading from "~/components/loading";
import ErrorComponent from "../../../../components/errorComponent";
import { useDrillInfo } from "../../../../hooks/useDrillInfo";
import { useDrillInfo } from "~/hooks/useDrillInfo";

export default function Description() {
const drillId = useLocalSearchParams()["id"];
Expand Down
57 changes: 28 additions & 29 deletions app/segments/drill/[id]/submission/result.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,34 +179,31 @@ function Result(props) {
<Text style={styles.sectionTitle}>Drill Results</Text>

{display()}

<ScrollView>
{submission["shots"].map((shot) => (
<ShotAccordion
key={shot["sid"]}
shot={shot}
drillInfo={props.drill}
total={numTrunc(submission["shots"].length)}
/>
))}
</ScrollView>
<Link
href={{
pathname: `/content/drill/${drillId}`,
}}
asChild
>
<Button
style={styles.restartButton}
mode="contained"
buttonColor="#F24E1E"
textColor="white"
>
Restart Drill
</Button>
</Link>
{submission["shots"].map((shot) => (
<ShotAccordion
key={shot["sid"]}
shot={shot}
drillInfo={props.drill}
total={numTrunc(submission["shots"].length)}
/>
))}
</ScrollView>
</SafeAreaView>
<Link
href={{
pathname: `/content/drill/${drillId}`,
}}
asChild
>
<Button
style={styles.restartButton}
mode="contained"
buttonColor="#F24E1E"
textColor="white"
>
Restart Drill
</Button>
</Link>
</PaperProvider>
</>
);
Expand Down Expand Up @@ -282,8 +279,10 @@ const styles = StyleSheet.create({
},

restartButton: {
marginTop: 15,
marginBottom: 45,
alignItems: "center",
margin: 10,
position: "absolute",
bottom: 10,
left: 0,
right: 0,
},
});

0 comments on commit fe5f5c7

Please sign in to comment.