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

feat: simplify pool item UI #2238

Merged
merged 2 commits into from
Sep 28, 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
10 changes: 9 additions & 1 deletion src/library/CallToAction/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export const CallToActionWrapper = styled.div`
}

.buttons {
border: 0.75px solid var(--border-primary-color);
border-radius: var(--button-border-radius);
display: flex;
flex-wrap: nowrap;
Expand Down Expand Up @@ -157,6 +156,15 @@ export const CallToActionWrapper = styled.div`
&.standalone {
border-radius: var(--button-border-radius);
flex-grow: 1;
margin-left: 0.75rem;

&:nth-child(1) {
margin-left: 0;
}

@media (max-width: 650px) {
margin-left: 0;
}
}

@media (max-width: 650px) {
Expand Down
4 changes: 2 additions & 2 deletions src/library/ListItem/Wrappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export const Wrapper = styled.div`
&.member {
--height-bottom-row: 2.75rem;
}
&.pool-more {
--height-bottom-row: 5.75rem;
&.pool {
--height-bottom-row: 3.25rem;
}

--height-total: calc(var(--height-top-row) + var(--height-bottom-row));
Expand Down
18 changes: 7 additions & 11 deletions src/library/Pool/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,39 +24,35 @@ export const Pool = ({ pool }: PoolProps) => {
const currentCommission = getCurrentCommission(id);

return (
<Wrapper className="pool-more">
<Wrapper className="pool">
<div className="inner">
<div className="row top">
<PoolIdentity pool={pool} />
<div>
<Labels>
<FavoritePool address={addresses.stash} />
<More
pool={pool}
setActiveTab={setActiveTab}
disabled={syncing}
/>
</Labels>
</div>
</div>
<Separator />
<div className="row bottom lg pools">
<div>
<Labels className="yMargin">&nbsp;</Labels>
<PoolNominateStatus pool={pool} />
</div>
<div>
<Labels className="yMargin">
<Labels>
{currentCommission > 0 && (
<PoolCommission commission={`${currentCommission}%`} />
)}
<PoolId id={id} />
<Members members={memberCounter} />
<PoolBonded pool={pool} />
</Labels>

<Labels>
<More
pool={pool}
setActiveTab={setActiveTab}
disabled={syncing}
/>
</Labels>
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/locale/cn/pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
"bondedFunds": "己质押金额",
"bouncer": "守护人",
"browseMembers": "浏览成员",
"browsePools": "浏览提名池",
"cancel": "取消",
"closePool": "可提取己解锁金额并关闭池",
"compound": "复利",
Expand Down
1 change: 1 addition & 0 deletions src/locale/en/pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
"bondedFunds": "Bonded Funds",
"bouncer": "Bouncer",
"browseMembers": "Browse Members",
"browsePools": "Browse Pools",
"cancel": "Cancel",
"closePool": "You can now withdraw and close the pool.",
"compound": "Compound",
Expand Down
9 changes: 8 additions & 1 deletion src/pages/Pools/Home/Status/NewMember.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ import { usePoolPerformance } from 'contexts/Pools/PoolPerformance';
import { PoolSync } from 'library/PoolSync';
import { useJoinPools } from 'contexts/Pools/JoinPools';
import { StyledLoader } from 'library/PoolSync/Loader';
import { usePoolsTabs } from '../context';

export const NewMember = ({ syncing }: NewMemberProps) => {
const { t } = useTranslation();
const { poolsForJoin } = useJoinPools();
const { setActiveTab } = usePoolsTabs();
const { openCanvas } = useOverlay().canvas;
const { startJoinPoolFetch } = useJoinPools();
const { getPoolPerformanceTask } = usePoolPerformance();
Expand Down Expand Up @@ -86,7 +88,7 @@ export const NewMember = ({ syncing }: NewMemberProps) => {
<section>
<div className="buttons">
<div
className={`button secondary standalone${createDisabled ? ` disabled` : ``}`}
className={`button standalone secondary ${createDisabled ? ` disabled` : ``}`}
>
<button
onClick={() =>
Expand All @@ -101,6 +103,11 @@ export const NewMember = ({ syncing }: NewMemberProps) => {
{t('pools.createPool', { ns: 'pages' })}
</button>
</div>
<div className={`button standalone secondary`}>
<button onClick={() => setActiveTab(1)}>
{t('pools.browsePools', { ns: 'pages' })}
</button>
</div>
</div>
</section>
</>
Expand Down
Loading