Skip to content

Commit

Permalink
wip: redirect to manage token page
Browse files Browse the repository at this point in the history
  • Loading branch information
MikaelVallenet committed Oct 22, 2024
1 parent d884d23 commit a0b7eff
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { SpacerColumn } from "@/components/spacer";
import { useForceNetworkSelection } from "@/hooks/useForceNetworkSelection";
import { NetworkFeature, NetworkKind } from "@/networks";
import { ScreenFC, useAppNavigation } from "@/utils/navigation";

Check failure on line 8 in packages/screens/LaunchpadERC20/LaunchpadERC20Tokens/LaunchpadERC20ManageToken.tsx

View workflow job for this annotation

GitHub Actions / lint-and-build

There should be at least one empty line between import groups
import { useState } from "react";

Check failure on line 9 in packages/screens/LaunchpadERC20/LaunchpadERC20Tokens/LaunchpadERC20ManageToken.tsx

View workflow job for this annotation

GitHub Actions / lint-and-build

There should be at least one empty line between import groups

Check failure on line 9 in packages/screens/LaunchpadERC20/LaunchpadERC20Tokens/LaunchpadERC20ManageToken.tsx

View workflow job for this annotation

GitHub Actions / lint-and-build

`react` import should occur before import of `../component/LaunchpadERC20DetailTokenBox`
import { LaunchpadERC20TokenAmountButton } from "../component/LaunchpadERC20TokenAmountButton";

Check failure on line 10 in packages/screens/LaunchpadERC20/LaunchpadERC20Tokens/LaunchpadERC20ManageToken.tsx

View workflow job for this annotation

GitHub Actions / lint-and-build

`../component/LaunchpadERC20TokenAmountButton` import should occur before import of `@/components/BrandText`

export const LaunchpadERC20ManageTokenScreen: ScreenFC<
"LaunchpadERC20ManageToken"
Expand All @@ -14,6 +16,8 @@ export const LaunchpadERC20ManageTokenScreen: ScreenFC<
const token = params.token;
useForceNetworkSelection(network);
const navigation = useAppNavigation();
const [mintAmount, setMintAmount] = useState(0);
const [burnAmount, setBurnAmount] = useState(0);

Check failure on line 20 in packages/screens/LaunchpadERC20/LaunchpadERC20Tokens/LaunchpadERC20ManageToken.tsx

View workflow job for this annotation

GitHub Actions / lint-and-build

'burnAmount' is assigned a value but never used

Check failure on line 20 in packages/screens/LaunchpadERC20/LaunchpadERC20Tokens/LaunchpadERC20ManageToken.tsx

View workflow job for this annotation

GitHub Actions / lint-and-build

'setBurnAmount' is assigned a value but never used

return (
<ScreenContainer
Expand All @@ -25,7 +29,12 @@ export const LaunchpadERC20ManageTokenScreen: ScreenFC<
onBackPress={() => navigation.navigate("LaunchpadERC20Tokens")}
>
<SpacerColumn size={8} />
<BrandText>

Check failure on line 32 in packages/screens/LaunchpadERC20/LaunchpadERC20Tokens/LaunchpadERC20ManageToken.tsx

View workflow job for this annotation

GitHub Actions / lint-and-build

Replace `⏎········Tokens·Details⏎······` with `Tokens·Details`
Tokens Details
</BrandText>
<SpacerColumn size={1} />
<LaunchpadERC20DetailTokenBox item={token} />
<LaunchpadERC20TokenAmountButton amount={mintAmount} setAmount={setMintAmount} buttonLabel={"Mint"} />

Check failure on line 37 in packages/screens/LaunchpadERC20/LaunchpadERC20Tokens/LaunchpadERC20ManageToken.tsx

View workflow job for this annotation

GitHub Actions / lint-and-build

Replace `·amount={mintAmount}·setAmount={setMintAmount}·buttonLabel={"Mint"}` with `⏎········amount={mintAmount}⏎········setAmount={setMintAmount}⏎········buttonLabel={"Mint"}⏎·····`

Check warning on line 37 in packages/screens/LaunchpadERC20/LaunchpadERC20Tokens/LaunchpadERC20ManageToken.tsx

View workflow job for this annotation

GitHub Actions / lint-and-build

Curly braces are unnecessary here
</ScreenContainer>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { TertiaryBox } from "@/components/boxes/TertiaryBox";
import { PrimaryButton } from "@/components/buttons/PrimaryButton";
import { Label } from "@/components/inputs/TextInputCustom";
import { neutral17, neutralFF } from "@/utils/style/colors";
import { fontSemibold16 } from "@/utils/style/fonts";
import { layout } from "@/utils/style/layout";

Check failure on line 6 in packages/screens/LaunchpadERC20/component/LaunchpadERC20TokenAmountButton.tsx

View workflow job for this annotation

GitHub Actions / lint-and-build

There should be at least one empty line between import groups
import { StyleProp, TextInput, View, ViewStyle } from "react-native";

Check failure on line 7 in packages/screens/LaunchpadERC20/component/LaunchpadERC20TokenAmountButton.tsx

View workflow job for this annotation

GitHub Actions / lint-and-build

`react-native` import should occur before import of `@/components/boxes/TertiaryBox`

interface LaunchpadERC20TokenAmountButtonProps {
amount: number;
setAmount: (amount: number) => void;
placeholder?: string;
buttonLabel: string;
onPress?: () => void;
disabled?: boolean;
viewStyle: StyleProp<ViewStyle>;
}

export const LaunchpadERC20TokenAmountButton: React.FC<LaunchpadERC20TokenAmountButtonProps> = ({
amount,
setAmount,
placeholder = "Amount",
buttonLabel,
onPress,
disabled,
viewStyle
}) => {
return (
<View
style={viewStyle}
>
<Label style={{ marginBottom: layout.spacing_x1 }} isRequired>
{placeholder}
</Label>

<TertiaryBox
style={{
width: "100%",
height: 40,
flexDirection: "row",
paddingHorizontal: 12,
backgroundColor: neutral17,
alignItems: "center",
}}
>
<TextInput
style={{
flex: 1,
color: neutralFF,
...fontSemibold16,
}}
placeholder={placeholder}
placeholderTextColor={neutralFF}
value={amount.toString()}
onChangeText={(text) => setAmount(Number(text))}
keyboardType="numeric"
/>
<PrimaryButton
onPress={onPress}
text={buttonLabel}
size="SM"
disabled={disabled}
/>
</TertiaryBox>
</View>
);
};

0 comments on commit a0b7eff

Please sign in to comment.