@@ -2,6 +2,7 @@ import React, { useState } from 'react';
22import { Form , Input , Button , Card } from 'antd' ;
33import { PlusOutlined } from '@ant-design/icons' ;
44import styled from 'styled-components' ;
5+ import { BREAKPOINTS } from '@app/styles/themes/constants' ;
56
67interface BlockPubkeyFormProps {
78 onSubmit : ( pubkey : string , reason ?: string ) => Promise < void > ;
@@ -13,22 +14,25 @@ const CardRoot = styled(Card)`
1314 box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
1415 background-color: var(--secondary-background-color) !important;
1516
16- & .ant-card-head {
17- border-bottom-color: var(--border-base-color) !important;
17+ & .ant-card-head {
18+ border-bottom-color: var(--border-base-color) !important;
1819 }
1920}
2021` ;
2122const TextArea = styled ( Input . TextArea ) `
2223 background-color: var(--layout-sider-bg-color) !important;
23- `
24+ ` ;
2425const InputArea = styled ( Input ) `
2526 background-color: var(--layout-sider-bg-color) !important;
2627` ;
28+ export const FormItemContainer = styled . div `
29+ width: 100%;
30+ @media screen and (min-width: ${ BREAKPOINTS . md } px) {
31+ padding-right: 1.5rem;
32+ }
33+ ` ;
2734
28- export const BlockPubkeyForm : React . FC < BlockPubkeyFormProps > = ( {
29- onSubmit,
30- disabled,
31- } ) => {
35+ export const BlockPubkeyForm : React . FC < BlockPubkeyFormProps > = ( { onSubmit, disabled } ) => {
3236 const [ form ] = Form . useForm ( ) ;
3337 const [ submitting , setSubmitting ] = useState ( false ) ;
3438
@@ -52,41 +56,24 @@ export const BlockPubkeyForm: React.FC<BlockPubkeyFormProps> = ({
5256 }
5357 return Promise . resolve ( ) ;
5458 } ;
55-
5659
5760 return (
5861 < CardRoot title = "Block a Pubkey" size = "small" >
59- < Form
60- form = { form }
61- layout = "vertical"
62- onFinish = { handleSubmit }
63- >
64- < Form . Item
65- name = "pubkey"
66- label = "Pubkey to block"
67- rules = { [ { validator : validatePubkey } ] }
68- >
69- < InputArea placeholder = "Enter the 64-character hex pubkey" />
70- </ Form . Item >
62+ < Form form = { form } layout = "vertical" onFinish = { handleSubmit } >
63+ < FormItemContainer >
64+ < Form . Item name = "pubkey" label = "Pubkey to block" rules = { [ { validator : validatePubkey } ] } >
65+ < InputArea placeholder = "Enter the 64-character hex pubkey" />
66+ </ Form . Item >
67+ </ FormItemContainer >
7168
72- < Form . Item
73- name = "reason"
74- label = "Reason (optional)"
75- >
76- < TextArea
77- placeholder = "Enter reason for blocking this pubkey"
78- rows = { 2 }
79- />
80- </ Form . Item >
69+ < FormItemContainer >
70+ < Form . Item name = "reason" label = "Reason (optional)" >
71+ < TextArea placeholder = "Enter reason for blocking this pubkey" rows = { 2 } />
72+ </ Form . Item >
73+ </ FormItemContainer >
8174
8275 < Form . Item >
83- < Button
84- type = "primary"
85- htmlType = "submit"
86- icon = { < PlusOutlined /> }
87- loading = { submitting }
88- disabled = { disabled }
89- >
76+ < Button type = "primary" htmlType = "submit" icon = { < PlusOutlined /> } loading = { submitting } disabled = { disabled } >
9077 Block Pubkey
9178 </ Button >
9279 </ Form . Item >
0 commit comments