From a3a71113aa5575f8c676f036cb658f228c6dfc21 Mon Sep 17 00:00:00 2001 From: Oleg Shilov Date: Tue, 5 Mar 2024 02:08:17 +0700 Subject: [PATCH 1/3] chore: use yarn global cache --- .yarnrc.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.yarnrc.yml b/.yarnrc.yml index d171c5551..fe9a9a7a3 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1,5 +1,3 @@ -cacheFolder: .yarn/cache - changesetBaseRefs: - dev - origin/dev @@ -9,8 +7,6 @@ compressionLevel: mixed defaultSemverRangePrefix: "" -enableGlobalCache: false - nodeLinker: node-modules npmScopes: From 4c5aa8fab00404d0743162193926325358cca19c Mon Sep 17 00:00:00 2001 From: Oleg Shilov Date: Tue, 5 Mar 2024 19:04:20 +0700 Subject: [PATCH 2/3] fix(staking): flor amount pasted in input when max button clicked --- .../shell/ui-kit/src/components/modal-input/modal-input.tsx | 3 --- .../components/delegate-modal/delegate-modal.stories.tsx | 2 +- .../src/components/delegate-modal/delegate-modal.tsx | 4 ++-- .../src/components/redelegate-modal/redelegate-modal.tsx | 2 +- .../components/undelegate-modal/undelegate-modal-hooked.tsx | 6 +++--- .../src/components/undelegate-modal/undelegate-modal.tsx | 2 +- 6 files changed, 8 insertions(+), 11 deletions(-) diff --git a/libs/shell/ui-kit/src/components/modal-input/modal-input.tsx b/libs/shell/ui-kit/src/components/modal-input/modal-input.tsx index 15dadba7f..c8ee25991 100644 --- a/libs/shell/ui-kit/src/components/modal-input/modal-input.tsx +++ b/libs/shell/ui-kit/src/components/modal-input/modal-input.tsx @@ -12,13 +12,10 @@ const defaultMaskOptions = { prefix: '', suffix: '', includeThousandsSeparator: true, - thousandsSeparatorSymbol: ',', allowDecimal: true, - decimalSymbol: '.', decimalLimit: 3, allowNegative: false, allowLeadingZeroes: false, - // integerLimit: 7, }; const CurrencyInput = ({ diff --git a/libs/staking/validator-details-page/src/components/delegate-modal/delegate-modal.stories.tsx b/libs/staking/validator-details-page/src/components/delegate-modal/delegate-modal.stories.tsx index 7a26c48ab..7e4b8fada 100644 --- a/libs/staking/validator-details-page/src/components/delegate-modal/delegate-modal.stories.tsx +++ b/libs/staking/validator-details-page/src/components/delegate-modal/delegate-modal.stories.tsx @@ -20,6 +20,6 @@ export const DelegateModal: Story = { delegation: 1000, isDisabled: false, unboundingTime: 21, - validatorCommission: '100', + validatorCommission: 10, }, }; diff --git a/libs/staking/validator-details-page/src/components/delegate-modal/delegate-modal.tsx b/libs/staking/validator-details-page/src/components/delegate-modal/delegate-modal.tsx index b9f3c8de7..f127b666f 100644 --- a/libs/staking/validator-details-page/src/components/delegate-modal/delegate-modal.tsx +++ b/libs/staking/validator-details-page/src/components/delegate-modal/delegate-modal.tsx @@ -128,8 +128,8 @@ export function DelegateModal({ onSubmit, }: DelegateModalProps) { const handleMaxButtonClick = useCallback(() => { - onChange(toFixedAmount(delegation, 3) ?? 0); - }, [delegation, onChange]); + onChange(Math.floor(balance)); + }, [balance, onChange]); const handleInputChange = useCallback( (value: string | undefined) => { diff --git a/libs/staking/validator-details-page/src/components/redelegate-modal/redelegate-modal.tsx b/libs/staking/validator-details-page/src/components/redelegate-modal/redelegate-modal.tsx index aceb6f1af..c480b4f2d 100644 --- a/libs/staking/validator-details-page/src/components/redelegate-modal/redelegate-modal.tsx +++ b/libs/staking/validator-details-page/src/components/redelegate-modal/redelegate-modal.tsx @@ -75,7 +75,7 @@ export function RedelegateModal({ onValidatorChange, }: RedelegateModalProps) { const handleMaxButtonClick = useCallback(() => { - onChange(toFixedAmount(delegation, 3) ?? 0); + onChange(Math.floor(delegation)); }, [delegation, onChange]); const handleInputChange = useCallback( diff --git a/libs/staking/validator-details-page/src/components/undelegate-modal/undelegate-modal-hooked.tsx b/libs/staking/validator-details-page/src/components/undelegate-modal/undelegate-modal-hooked.tsx index 4ce0e5a56..cd3743083 100644 --- a/libs/staking/validator-details-page/src/components/undelegate-modal/undelegate-modal-hooked.tsx +++ b/libs/staking/validator-details-page/src/components/undelegate-modal/undelegate-modal-hooked.tsx @@ -107,20 +107,20 @@ export function UndelegateModalHooked({ undelegate, validatorAddress, undelegateAmount, + balance, + fee, toast, onClose, explorer.cosmos, ]); useEffect(() => { - const fixedDelegation = toFixedAmount(delegation, 3) ?? 0; - if (throttledUndelegateAmount && throttledUndelegateAmount <= 0) { setUndelegateEnabled(false); setAmountError('min'); } else if ( throttledUndelegateAmount && - throttledUndelegateAmount > fixedDelegation + throttledUndelegateAmount > delegation ) { setUndelegateEnabled(false); setAmountError('max'); diff --git a/libs/staking/validator-details-page/src/components/undelegate-modal/undelegate-modal.tsx b/libs/staking/validator-details-page/src/components/undelegate-modal/undelegate-modal.tsx index 1d17e8ba9..bf71c4a01 100644 --- a/libs/staking/validator-details-page/src/components/undelegate-modal/undelegate-modal.tsx +++ b/libs/staking/validator-details-page/src/components/undelegate-modal/undelegate-modal.tsx @@ -43,7 +43,7 @@ export function UndelegateModal({ onSubmit, }: UndelegateModalProps) { const handleMaxButtonClick = useCallback(() => { - onChange(toFixedAmount(delegation, 3) ?? 0); + onChange(Math.floor(delegation)); }, [delegation, onChange]); const handleInputChange = useCallback( From 632064564d589e70bf36c37dd04364cb4861ee57 Mon Sep 17 00:00:00 2001 From: Oleg Shilov Date: Tue, 5 Mar 2024 19:04:36 +0700 Subject: [PATCH 3/3] chore: update some stories --- .../proposal-deposit-modal.stories.tsx | 4 ++-- .../lib/member-modal-card/member-card-modal.stories.tsx | 6 +++--- .../ui-kit/src/lib/news-card/news-card.stories.tsx | 9 +++------ 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/libs/governance/proposal-details/src/components/proposal-deposit-modal/proposal-deposit-modal.stories.tsx b/libs/governance/proposal-details/src/components/proposal-deposit-modal/proposal-deposit-modal.stories.tsx index 6b674a40d..ab73d17dd 100644 --- a/libs/governance/proposal-details/src/components/proposal-deposit-modal/proposal-deposit-modal.stories.tsx +++ b/libs/governance/proposal-details/src/components/proposal-deposit-modal/proposal-deposit-modal.stories.tsx @@ -3,7 +3,7 @@ import { ProposalDepositModal as ProposalDepositModalComponent } from './proposa const meta: Meta = { component: ProposalDepositModalComponent, - title: 'shell/ui-kit', + title: 'shell/ui-kit/modals/plug-and-play', parameters: { layout: 'centered', }, @@ -14,7 +14,7 @@ type Story = StoryObj; export const ProposalDepositModal: Story = { args: { - balance: 250, + balance: 250.48819, isOpen: true, }, }; diff --git a/libs/islamic-website/ui-kit/src/lib/member-modal-card/member-card-modal.stories.tsx b/libs/islamic-website/ui-kit/src/lib/member-modal-card/member-card-modal.stories.tsx index ce509260d..9ebcb804d 100644 --- a/libs/islamic-website/ui-kit/src/lib/member-modal-card/member-card-modal.stories.tsx +++ b/libs/islamic-website/ui-kit/src/lib/member-modal-card/member-card-modal.stories.tsx @@ -14,9 +14,9 @@ type Story = StoryObj; export const MemberModalCard: Story = { args: { - title: 'Sheikh Dr. Hazza bin Sultan bin Zayed Al Nahyan', + title: 'Alexander Jonathan Sebastian-Carrington', description: - "His Highness Sheikh Dr. Hazza Bin Sultan Bin Zayed Al Nahyan is Chairman of the Board of Directors of the Management of H. H. Sheikh Sultan Bin Zayed Al Nahyan. He also chairs the Board of Directors of holding companies concerned with Real Estate and Economic Development. Sheikh Dr. Hazza completed his Ph.D. in natural resources, Economic Development and Security in the United Arab Emirates from Bangor University in the United Kingdom in 2009. This is after completing his master's thesis in the philosophy of modern societies and global transformation from the University of Cambridge, United Kingdom, in 2007.", - image: 'https://picsum.photos/200/300', + 'Alexander Jonathan Sebastian-Carrington is a renowned historian and linguist, known for his extensive research in ancient Mediterranean civilizations. With a career spanning over three decades, Alexander has contributed significantly to the understanding of early human societies through his innovative approach to deciphering ancient scripts. His work has not only enriched academic discourse but also made ancient history accessible to a wider audience, earning him numerous awards and accolades in the field of historical studies.', + image: 'https://picsum.photos/400/300', }, }; diff --git a/libs/islamic-website/ui-kit/src/lib/news-card/news-card.stories.tsx b/libs/islamic-website/ui-kit/src/lib/news-card/news-card.stories.tsx index ef33fa957..f66280661 100644 --- a/libs/islamic-website/ui-kit/src/lib/news-card/news-card.stories.tsx +++ b/libs/islamic-website/ui-kit/src/lib/news-card/news-card.stories.tsx @@ -4,9 +4,6 @@ import { NewsCard as NewsCardComponent } from './news-card'; const meta: Meta = { component: NewsCardComponent, title: 'islamic-website/ui-kit', - parameters: { - layout: 'centered', - }, }; export default meta; @@ -20,9 +17,9 @@ export const NewsCard: Story = { description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.', image: { - height: 300, - width: 200, - src: 'https://picsum.photos/200/300', + height: 1800, + width: 1000, + src: 'https://picsum.photos/1800/1000', }, source: 'https://picsum.photos', type: 'type',