Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UI] - Various small final fixes to form #52

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions web/src/app/manage/Assets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ export const Assets = ({ setValue, watch, assets }: AssetProps) => {
<div className="flex flex-wrap gap-2 ">
{tokenList.map((token) => (
<SelectableTile
className="max-w-[40px] max-h-[40px] lg:max-w-[170px] lg:max-h-[80px] w-full h-full"
className="max-w-[40px] max-h-[40px] lg:max-w-[130px] lg:max-h-[50px] w-full h-full items-center"
style={{
// if not selected, white background
backgroundColor:
assets?.includes(token.tokenMint) ||
watch("fundAsset") === token.symbol
watch("shareClassAsset") === token.symbol
? "#e5e7eb"
: "#FFFFFF"
}}
id={token.symbol}
key={token.tokenMint}
value={token.symbol}
disabled={token.symbol === watch("fundAsset")}
disabled={token.symbol === watch("shareClassAsset")}
selected={
token.symbol === watch("fundAsset") ||
token.symbol === watch("shareClassAsset") ||
assets?.includes(token.tokenMint)
}
onClick={() => {
Expand All @@ -49,13 +49,13 @@ export const Assets = ({ setValue, watch, assets }: AssetProps) => {
}
}}
>
<div className="flex items-center gap-2 justify-center h-full">
<div className="flex items-center gap-2 justify-center h-full items-center">
<img
src={token.imgURL}
className="h-[10px] w-[10px] lg:h-[30px] lg:w-[30px] rounded-full"
alt="Token Logo"
/>
<p className="lg:text-[22px] font-bold">{token.symbol}</p>
<p className="lg:text-[13px] font-bold">{token.symbol}</p>
</div>
</SelectableTile>
))}
Expand Down
1 change: 1 addition & 0 deletions web/src/app/manage/CreateProduct.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ export const CreateProduct = () => {
register={register}
errors={errors}
errorStyle={errorStyle}
assets={assets}
/>
) : currentIndex === 2 ? (
<Policies
Expand Down
14 changes: 10 additions & 4 deletions web/src/app/manage/ShareClasses.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type ShareClassProps = {
register: UseFormRegister<FormFields>;
errors: FieldErrors<FormFields>;
errorStyle: React.CSSProperties;
assets: string[] | undefined;
};

export const ShareClasses = ({
Expand All @@ -25,7 +26,8 @@ export const ShareClasses = ({
getValues,
register,
errors,
errorStyle
errorStyle,
assets
}: ShareClassProps) => {
return (
<>
Expand All @@ -35,7 +37,7 @@ export const ShareClasses = ({
id="full-share-class-name"
labelText="Full Share Class Name"
value={`${watch("fundName")} ${watch("extension")} ${watch(
"fundAsset"
"shareClassAsset"
)}`}
helperText="The full name of the share class, including the fund name, extension, and asset."
readOnly
Expand All @@ -50,13 +52,13 @@ export const ShareClasses = ({
setValue(
"fullShareClassName",
`${getValues("fundName")} ${e.selectedItem?.id} ${getValues(
"fundAsset"
"shareClassAsset"
)}`
);
setValue(
"shareClassSymbol",
`${getValues("fundSymbol")}-${e.selectedItem?.id}-${getValues(
"fundAsset"
"shareClassAsset"
)}`
);
}}
Expand Down Expand Up @@ -86,6 +88,10 @@ export const ShareClasses = ({
onChange={(e) => {
setValue("shareClassAsset", e.selectedItem?.symbol ?? "");
setValue("shareClassAssetID", e.selectedItem?.tokenMint ?? "");
setValue(
"assets",
(assets ?? []).concat(e.selectedItem?.tokenMint ?? "")
);
}}
items={tokenList}
itemToString={(item) => (item ? item.symbol : "")}
Expand Down
31 changes: 24 additions & 7 deletions web/src/app/manage/Strategies.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const Strategies = ({
<div className="flex flex-col gap-2 w-full max-w-[200px]">
{strategies.map((strategy) => (
<SelectableTile
className="h-full "
id={strategy.id}
key={strategy.id}
value={strategy.id}
Expand All @@ -57,21 +58,37 @@ export const Strategies = ({
}}
>
{strategy.id === "Drift" ? (
<img src={driftLogo} alt="Drift Logo" />
<img
src={driftLogo}
alt="Drift Logo"
className="h-[50px] w-full"
/>
) : strategy.id === "Backpack" ? (
<>
<img src={backpackLogo} alt="Backpack Logo" />
<p>Coming Soon...</p>
<img
src={backpackLogo}
alt="Backpack Logo"
className="h-[50px] w-full"
/>
{/* <p>Coming Soon...</p> */}
</>
) : strategy.id === "Jupiter" ? (
<>
<img src={jupiterLogo} alt="Jupiter Logo" />
<p>Coming Soon...</p>
<img
src={jupiterLogo}
alt="Jupiter Logo"
className="h-[50px] w-full"
/>
{/* <p>Coming Soon...</p> */}
</>
) : (
<>
<img src={orcaLogo} alt="Orca Logo" />
<p>Coming Soon...</p>
<img
src={orcaLogo}
alt="Orca Logo"
className="h-[50px] w-full"
/>
{/* <p>Coming Soon...</p> */}
</>
)}
</SelectableTile>
Expand Down
Loading