From d377ab9deae0c2e208feb42fc01eaa21a0e950cc Mon Sep 17 00:00:00 2001 From: Nikolai Schunk <58025175+nikolaischunk@users.noreply.github.com> Date: Tue, 9 Apr 2024 16:53:46 +0200 Subject: [PATCH] Add simple textarea --- src/components/GuildConfig/ConfigInput.tsx | 59 +++++++++++++++++----- src/components/GuildConfig/GuildConfig.tsx | 15 +++++- 2 files changed, 58 insertions(+), 16 deletions(-) diff --git a/src/components/GuildConfig/ConfigInput.tsx b/src/components/GuildConfig/ConfigInput.tsx index 22356b4..cae4156 100644 --- a/src/components/GuildConfig/ConfigInput.tsx +++ b/src/components/GuildConfig/ConfigInput.tsx @@ -1,6 +1,7 @@ 'use client'; import { timezonesOffsets } from '@/types/config'; import { Input, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/ui'; +import { Textarea } from '@/ui/textarea'; import { APIChannel, APIRole } from 'discord-api-types/v10'; import { useState } from 'react'; @@ -19,6 +20,13 @@ interface ConfigChannelInputProps { interface ConfigTimezoneOffsetInputProps { defaultTimezoneOffset: string; + option: 1 | 2; + guildId: string; +} + +interface ConfigBirthdayMessageInputProps { + defaultBirthdayMessage: string; + premium: boolean; guildId: string; } @@ -68,25 +76,48 @@ export function ConfigChannelInput({ channels, defaultChannel }: ConfigChannelIn ); } -export function ConfigTimezoneOffsetInput({ defaultTimezoneOffset }: ConfigTimezoneOffsetInputProps) { +export function ConfigTimezoneOffsetInput({ defaultTimezoneOffset, option }: ConfigTimezoneOffsetInputProps) { const [selectedTimezone, setSelectedTimezone] = useState(defaultTimezoneOffset); return (
- setSelectedTimezone(e.target.value)} /> + {option === 1 ? ( + setSelectedTimezone(e.target.value)} + max={'12'} + min={'-11'} + step={'1'} + placeholder="Timezone offset" + /> + ) : ( + + )} +
+ ); +} - +export function ConfigBirthdayMessageInput({ + defaultBirthdayMessage, + premium, + guildId, +}: ConfigBirthdayMessageInputProps) { + return ( +
+ +