diff --git a/src/components/RadioButton.tsx b/src/components/RadioButton.tsx
new file mode 100644
index 0000000..a2bd352
--- /dev/null
+++ b/src/components/RadioButton.tsx
@@ -0,0 +1,46 @@
+import React, { useState } from 'react';
+import { Text, Pressable, StyleSheet } from 'react-native';
+
+import theme from 'src/theme';
+
+export default function RadioButton({ data, onSelect, defaultValue }) {
+ const [userOption, setUserOption] = useState(defaultValue.value);
+
+ const selectHandler = (value) => {
+ onSelect(value);
+ setUserOption(value);
+ };
+
+ return (
+ <>
+ {data.map((item) => {
+ return (
+ selectHandler(item.value)}
+ >
+ {item.label}
+
+ );
+ })}
+ >
+ );
+}
+
+const styles = StyleSheet.create({
+ box: {
+ padding: 12,
+ margin: 4,
+ borderRadius: 12,
+ },
+ selected: {
+ backgroundColor: theme.colors.neufOrange,
+ },
+ unselected: {
+ backgroundColor: theme.colors.gray1,
+ },
+ text: {
+ textAlign: 'center',
+ },
+});
diff --git a/src/modules/membership/Proof.tsx b/src/modules/membership/Proof.tsx
index dbaaee8..405f51b 100644
--- a/src/modules/membership/Proof.tsx
+++ b/src/modules/membership/Proof.tsx
@@ -12,9 +12,9 @@ import {
GestureResponderEvent,
} from 'react-native';
import Confetti from 'react-native-confetti';
-import RadioForm from 'react-native-simple-radio-button';
import { Button, Incubator } from 'react-native-ui-lib';
+import RadioButton from 'src/components/RadioButton';
import theme from 'src/theme';
import type { UserType } from 'src/types/data';
@@ -88,34 +88,30 @@ const PurchaseButton = ({
membershipPrice,
setMembershipTypeSlug,
}: PurchaseButtonProps) => {
- if (user.is_member) {
- return null;
- }
-
const options = [
{ label: 'Student', value: 'student' },
{ label: 'Ordinær', value: 'regular' },
{ label: 'Støtte', value: 'support' },
];
+ const defaultValue = options[1];
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ useEffect(() => onSelect(defaultValue.value), []);
+
const onSelect = (value: string) => {
setMembershipTypeSlug(value);
};
+ if (user.is_member) {
+ return null;
+ }
+
return (
-
+ Velg medlemskapstype
+
+
+
{paymentLoading && }