Skip to content

Commit

Permalink
chore: added title to Veolas for duplicate title error in SEMrush
Browse files Browse the repository at this point in the history
  • Loading branch information
atepem committed Nov 13, 2024
1 parent c93bed6 commit e555025
Showing 1 changed file with 61 additions and 48 deletions.
109 changes: 61 additions & 48 deletions apps/govern/components/VeOlas/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { Alert, Button, Card, Space, Typography } from 'antd';
import { useState } from 'react';
import styled from 'styled-components';
import { Alert, Button, Card, Space, Typography } from "antd";

Check failure on line 1 in apps/govern/components/VeOlas/index.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `"antd"` with `'antd'`
import { useState } from "react";

Check failure on line 2 in apps/govern/components/VeOlas/index.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `"react"` with `'react'`
import styled from "styled-components";

Check failure on line 3 in apps/govern/components/VeOlas/index.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `"styled-components"` with `'styled-components'`

import { useFetchBalances } from 'hooks/index';
import { useFetchBalances } from "hooks/index";

Check failure on line 5 in apps/govern/components/VeOlas/index.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `"hooks/index"` with `'hooks/index'`

import { CreateLockModal } from './CreateLockModal';
import { IncreaseLockModal } from './IncreaseLockModal';
import { VeOlasManage } from './VeOlasManage';
import { CreateLockModal } from "./CreateLockModal";

Check failure on line 7 in apps/govern/components/VeOlas/index.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `"./CreateLockModal"` with `'./CreateLockModal'`
import { IncreaseLockModal } from "./IncreaseLockModal";

Check failure on line 8 in apps/govern/components/VeOlas/index.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `"./IncreaseLockModal"` with `'./IncreaseLockModal'`
import { VeOlasManage } from "./VeOlasManage";

Check failure on line 9 in apps/govern/components/VeOlas/index.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `"./VeOlasManage"` with `'./VeOlasManage'`
import { GetServerSideProps } from "next";

Check failure on line 10 in apps/govern/components/VeOlas/index.tsx

View workflow job for this annotation

GitHub Actions / build

'GetServerSideProps' is defined but never used

Check failure on line 10 in apps/govern/components/VeOlas/index.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `"next"` with `'next'`
import Head from "next/head";

Check failure on line 11 in apps/govern/components/VeOlas/index.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `"next/head"` with `'next/head'`

const { Paragraph } = Typography;

Expand All @@ -23,53 +25,64 @@ const Title = styled.h1`
`;

export const VeOlasPage = () => {
const { isLoading, canWithdrawVeolas, canIncreaseAmountOrUnlock } = useFetchBalances();
const { isLoading, canWithdrawVeolas, canIncreaseAmountOrUnlock } =
useFetchBalances();

const [isCreateLockModalVisible, setIsCreateLockModalVisible] = useState(false);
const [isCreateLockModalVisible, setIsCreateLockModalVisible] =
useState(false);
const [isIncreaseModalVisible, setIsIncreaseModalVisible] = useState(false);

return (
<StyledMain>
<Card>
<Title>veOLAS</Title>
<Paragraph type="secondary" className="mt-8 mb-24">
veOLAS gives you voting power in Olas governance. Lock OLAS for longer periods to get more
veOLAS.
</Paragraph>
<Space size="middle" className="mb-16">
<Button
type="primary"
size="large"
disabled={isLoading || !!canWithdrawVeolas}
onClick={() => {
// if the user has veolas, then show the modal to increase the amount
// else show the modal to create a lock
if (canIncreaseAmountOrUnlock) {
setIsIncreaseModalVisible(true);
} else {
setIsCreateLockModalVisible(true);
}
}}
>
Lock OLAS for veOLAS
</Button>
<>
<Head>
<title>VeOlas</title>
</Head>
<StyledMain>
<Card>
<Title>veOLAS</Title>
<Paragraph type="secondary" className="mt-8 mb-24">
veOLAS gives you voting power in Olas governance. Lock OLAS for
longer periods to get more veOLAS.
</Paragraph>
<Space size="middle" className="mb-16">
<Button
type="primary"
size="large"
disabled={isLoading || !!canWithdrawVeolas}
onClick={() => {
// if the user has veolas, then show the modal to increase the amount
// else show the modal to create a lock
if (canIncreaseAmountOrUnlock) {
setIsIncreaseModalVisible(true);
} else {
setIsCreateLockModalVisible(true);
}
}}
>
Lock OLAS for veOLAS
</Button>

{canWithdrawVeolas && (
<Alert message="Please claim your OLAS before locking again" type="warning" showIcon />
)}
</Space>
{canWithdrawVeolas && (
<Alert
message="Please claim your OLAS before locking again"
type="warning"
showIcon
/>
)}
</Space>

<VeOlasManage />
<VeOlasManage />

<CreateLockModal
isModalVisible={isCreateLockModalVisible}
setIsModalVisible={setIsCreateLockModalVisible}
/>
<IncreaseLockModal
isModalVisible={isIncreaseModalVisible}
setIsModalVisible={setIsIncreaseModalVisible}
/>
</Card>
</StyledMain>
<CreateLockModal
isModalVisible={isCreateLockModalVisible}
setIsModalVisible={setIsCreateLockModalVisible}
/>
<IncreaseLockModal
isModalVisible={isIncreaseModalVisible}
setIsModalVisible={setIsIncreaseModalVisible}
/>
</Card>
</StyledMain>
</>
);
};

0 comments on commit e555025

Please sign in to comment.