Skip to content

Commit

Permalink
style: auto adjust width (#434)
Browse files Browse the repository at this point in the history
LGTM
  • Loading branch information
Layouwen authored Dec 31, 2024
1 parent 1e3febd commit 7b28f92
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/renderer/src/components/profiles/edit-info-modal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
cn,
Modal,
ModalContent,
ModalHeader,
Expand Down Expand Up @@ -29,6 +30,7 @@ const EditInfoModal: React.FC<Props> = (props) => {
const { overrideConfig } = useOverrideConfig()
const { items: overrideItems = [] } = overrideConfig || {}
const [values, setValues] = useState(item)
const inputWidth = 'w-[400px] md:w-[400px] lg:w-[600px] xl:w-[800px]'

const onSave = async (): Promise<void> => {
try {
Expand All @@ -49,7 +51,11 @@ const EditInfoModal: React.FC<Props> = (props) => {
return (
<Modal
backdrop="blur"
classNames={{ backdrop: 'top-[48px]' }}
size="5xl"
classNames={{
backdrop: 'top-[48px]',
base: 'w-[600px] md:w-[600px] lg:w-[800px] xl:w-[1024px]'
}}
hideCloseButton
isOpen={true}
onOpenChange={onClose}
Expand All @@ -61,7 +67,7 @@ const EditInfoModal: React.FC<Props> = (props) => {
<SettingItem title="名称">
<Input
size="sm"
className="w-[200px]"
className={cn(inputWidth)}
value={values.name}
onValueChange={(v) => {
setValues({ ...values, name: v })
Expand All @@ -73,7 +79,7 @@ const EditInfoModal: React.FC<Props> = (props) => {
<SettingItem title="订阅地址">
<Input
size="sm"
className="w-[200px]"
className={cn(inputWidth)}
value={values.url}
onValueChange={(v) => {
setValues({ ...values, url: v })
Expand All @@ -93,7 +99,7 @@ const EditInfoModal: React.FC<Props> = (props) => {
<Input
size="sm"
type="number"
className="w-[200px]"
className={cn(inputWidth)}
value={values.interval?.toString() ?? ''}
onValueChange={(v) => {
setValues({ ...values, interval: parseInt(v) })
Expand Down

0 comments on commit 7b28f92

Please sign in to comment.