Skip to content

Commit

Permalink
UX Improvement (#20)
Browse files Browse the repository at this point in the history
* Remove ConnectWallet from header

* Reposition Send and Recipient above From and To

* Update max-width of ChainSelect

* Update width of AssetSelect

* Update disabled style of BalanceInput

* Update styles of Transfer

* Update slack_channel
  • Loading branch information
JayJay1024 authored Apr 30, 2024
1 parent 462174c commit af26dec
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ jobs:
script_run: false
dist_path: .
enable_notify_slack: true
slack_channel: darwinia-apps
slack_channel: public-darwinia-websites-apps
slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}
2 changes: 1 addition & 1 deletion .github/workflows/deploy-prd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ jobs:
script_run: false
dist_path: .
enable_notify_slack: true
slack_channel: darwinia-apps
slack_channel: public-darwinia-websites-apps
slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}

2 changes: 1 addition & 1 deletion .github/workflows/deploy-stg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ jobs:
script_run: false
dist_path: .
enable_notify_slack: true
slack_channel: darwinia-apps
slack_channel: public-darwinia-websites-apps
slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}
2 changes: 1 addition & 1 deletion src/components/asset-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function AssetSelect({ value, options, disabled, onChange = () =>
}
disabled={disabled}
sameWidth
labelClassName="flex items-center gap-middle shrink-0 w-28 justify-between bg-component h-full border-radius px-1 hover:opacity-80 transition-[transform,color] disabled:translate-y-0 disabled:opacity-100 disabled:cursor-not-allowed"
labelClassName="flex items-center gap-middle shrink-0 w-32 justify-between bg-component h-full border-radius px-1 hover:opacity-80 transition-[transform,color] disabled:translate-y-0 disabled:opacity-100 disabled:cursor-not-allowed"
childClassName="flex flex-col py-small bg-component border-primary border border-radius gap-[1px]"
>
{options?.length ? (
Expand Down
2 changes: 1 addition & 1 deletion src/components/balance-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default function BalanceInput({
<div
className={`border-radius relative flex h-12 items-center justify-between border p-1 transition-colors ${
value?.valid === false ? "border-alert" : "border-transparent"
}`}
} ${disabled ? "opacity-50" : ""}`}
>
<Input
disabled={disabled}
Expand Down
2 changes: 1 addition & 1 deletion src/components/chain-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function ChainSelect({ value, options, disabled, onChange = () =>
return (
<Select
label={
<div className="flex max-w-[140px] items-center gap-small">
<div className="flex max-w-[12rem] items-center gap-small">
<Image width={20} height={20} alt="Chain logo" src={getChainLogoSrc(value.logo)} />
<span className="truncate text-white/50">{value.name}</span>
</div>
Expand Down
4 changes: 0 additions & 4 deletions src/components/header.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import Image from "next/image";
import Link from "next/link";
import dynamic from "next/dynamic";

const ConnectWallet = dynamic(() => import("@/components/connect-wallet"), { ssr: false });

export default function Header() {
return (
Expand All @@ -11,7 +8,6 @@ export default function Header() {
<Link href="/">
<Image width={156} height={18} alt="Logo" src="/images/logo.png" />
</Link>
<ConnectWallet kind="primary" who="sender" />
</div>
</div>
);
Expand Down
64 changes: 32 additions & 32 deletions src/components/transfer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,41 @@ export default function Transfer() {
: [];

return (
<div className="border-radius mx-auto mt-10 flex w-[30rem] flex-col gap-5 bg-component p-5 pb-8">
<div className="border-radius mx-auto mt-10 flex w-[34rem] flex-col gap-5 bg-component p-5 pb-8 shadow-2xl">
{/* Sender */}
<TransferSection label="Sender" className="border-radius mt-10 border-[2px] border-white/20">
<AddressInput
who="sender"
placeholder="Select an address"
value={sender}
options={senderOptions}
accounts={activeSenderWallet === WalletID.TALISMAN ? talismanAccounts : []}
onClear={setSender}
onChange={setSender}
onAccountChange={setActiveSenderAccount}
/>
</TransferSection>

{/* Recipient */}
<TransferSection label="Recipient" className="border-radius mt-10 border-[2px] border-white/20">
<AddressInput
canInput
who="recipient"
placeholder="Select or enter an address"
value={recipient}
options={recipientOptions}
accounts={activeRecipientWallet === WalletID.TALISMAN ? talismanAccounts : []}
onClear={setRecipient}
onChange={setRecipient}
onAccountChange={setActiveRecipientAccount}
/>
</TransferSection>

{/* From */}
<TransferSection
label="From"
extra={<ChainSelect value={sourceChain} options={sourceChainOptions} onChange={_setSourceChain} />}
className="mb-3 mt-12"
className="border-radius mb-3 mt-12 border-[2px] border-white/20"
>
<BalanceInput
value={transferAmount}
Expand All @@ -265,40 +294,11 @@ export default function Transfer() {
<TransferSection
label="To"
extra={<ChainSelect value={targetChain} options={targetChainOptions} onChange={_setTargetChain} />}
className="mt-3"
className="border-radius mt-3 border border-transparent"
>
<BalanceInput disabled asset={targetAsset} balance={targetBalance?.asset.value} placeholder="Balance 0" />
</TransferSection>

{/* Sender */}
<TransferSection label="Sender" className="mt-10">
<AddressInput
who="sender"
placeholder="Select an address"
value={sender}
options={senderOptions}
accounts={activeSenderWallet === WalletID.TALISMAN ? talismanAccounts : []}
onClear={setSender}
onChange={setSender}
onAccountChange={setActiveSenderAccount}
/>
</TransferSection>

{/* Recipient */}
<TransferSection label="Recipient" className="mt-10">
<AddressInput
canInput
who="recipient"
placeholder="Select or enter an address"
value={recipient}
options={recipientOptions}
accounts={activeRecipientWallet === WalletID.TALISMAN ? talismanAccounts : []}
onClear={setRecipient}
onChange={setRecipient}
onAccountChange={setActiveRecipientAccount}
/>
</TransferSection>

{/* Send */}
<Button
kind="primary"
Expand Down

0 comments on commit af26dec

Please sign in to comment.