Skip to content

Commit 3757aca

Browse files
committed
feat: Add ArgoCDForm
1 parent a10562e commit 3757aca

2 files changed

Lines changed: 46 additions & 5 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { Form, Input } from 'antd';
2+
import { CopyOutlined, CheckOutlined } from '@ant-design/icons';
3+
import { createStyles } from 'antd-style';
4+
import useCopy from '../../hooks/useCopy';
5+
6+
const USER_NAME = 'poolini';
7+
8+
const PASSWORD = 'rgbc0ffee';
9+
10+
export default function MyPageArgoCDForm() {
11+
const { styles } = useStyles();
12+
13+
const { isCopied: isUserNameCopied, copy: copyUserName } = useCopy();
14+
const { isCopied: isPasswordCopied, copy: copyPassword } = useCopy();
15+
16+
return (
17+
<Form layout="vertical">
18+
<Form.Item label="username" className={styles.inputWrap}>
19+
<Input value={USER_NAME} readOnly addonAfter={isUserNameCopied ? <CheckOutlined /> : <CopyOutlined onClick={() => copyUserName(USER_NAME)} />} />
20+
</Form.Item>
21+
<Form.Item label="password" className={styles.inputWrap}>
22+
<Input value={PASSWORD} readOnly addonAfter={isPasswordCopied ? <CheckOutlined /> : <CopyOutlined onClick={() => copyPassword(PASSWORD)} />} />
23+
</Form.Item>
24+
</Form>
25+
);
26+
}
27+
28+
const useStyles = createStyles(({ css }) => ({
29+
inputWrap: css({
30+
marginBottom: '8px',
31+
}),
32+
}));

websites/poolc.org/src/components/my-page/MyPagePKSSection.tsx

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
import { CopyOutlined, CheckOutlined, ArrowRightOutlined, SettingTwoTone, BookTwoTone, DeploymentUnitOutlined, EyeTwoTone } from '@ant-design/icons';
2-
import { Typography, Space, Button, List } from 'antd';
1+
import { CopyOutlined, CheckOutlined, ArrowRightOutlined, SettingTwoTone, BookTwoTone, DeploymentUnitOutlined, EyeTwoTone, QuestionCircleFilled } from '@ant-design/icons';
2+
import { Button, Popover, Space, Typography, List } from 'antd';
33
import { createStyles } from 'antd-style';
4-
import useCopy from '../../hooks/useCopy';
4+
import { ReactNode } from 'react';
5+
import useCopy from '~/hooks/useCopy';
6+
import MyPageArgoCDForm from './MyPageArgoCDForm';
57

68
export default function MyPagePKSSection({ jwtToken }: { jwtToken: string }) {
79
const { styles } = useStyles();
810
const { isCopied, copy } = useCopy();
911

1012
const linkList: {
11-
title: string;
13+
title: ReactNode;
1214
icon: JSX.Element;
1315
link: string;
1416
}[] = [
@@ -23,7 +25,14 @@ export default function MyPagePKSSection({ jwtToken }: { jwtToken: string }) {
2325
link: 'https://github.com/PoolC/PKS-docs/tree/main',
2426
},
2527
{
26-
title: 'Argo CD',
28+
title: (
29+
<Space size={4}>
30+
Argo CD
31+
<Popover title="계정정보" content={<MyPageArgoCDForm />}>
32+
<QuestionCircleFilled />
33+
</Popover>
34+
</Space>
35+
),
2736
icon: <DeploymentUnitOutlined size={24} />,
2837
link: 'http://argocd.dev.poolc.org',
2938
},

0 commit comments

Comments
 (0)