-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #315 from valory-xyz/mohan/staking-contract-ui
feat: move the staking contract info to the main screen
- Loading branch information
Showing
6 changed files
with
79 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
frontend/components/MainPage/sections/StakingContractUpdate.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { RightOutlined } from '@ant-design/icons'; | ||
import { Button, Flex, Skeleton, Typography } from 'antd'; | ||
|
||
import { Pages } from '@/enums/PageState'; | ||
import { usePageState } from '@/hooks/usePageState'; | ||
import { useStakingProgram } from '@/hooks/useStakingProgram'; | ||
|
||
import { CardSection } from '../../styled/CardSection'; | ||
|
||
const { Text } = Typography; | ||
|
||
export const StakingContractUpdate = () => { | ||
const { goto } = usePageState(); | ||
const { activeStakingProgramMeta, isLoadedActiveStakingProgram } = | ||
useStakingProgram(); | ||
|
||
return ( | ||
<CardSection bordertop="true" padding="16px 24px"> | ||
<Flex | ||
gap={16} | ||
justify="space-between" | ||
align="center" | ||
style={{ width: '100%' }} | ||
> | ||
<Text type="secondary">Staking contract</Text> | ||
|
||
{isLoadedActiveStakingProgram ? ( | ||
<Button | ||
type="link" | ||
className="p-0" | ||
onClick={() => goto(Pages.ManageStaking)} | ||
> | ||
{activeStakingProgramMeta ? ( | ||
<> | ||
{activeStakingProgramMeta.name} | ||
| ||
<RightOutlined /> | ||
</> | ||
) : ( | ||
'Not staked' | ||
)} | ||
</Button> | ||
) : ( | ||
<Skeleton.Input /> | ||
)} | ||
</Flex> | ||
</CardSection> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 0 additions & 58 deletions
58
frontend/components/SettingsPage/SettingsStakingContractSection.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters