Skip to content

Commit

Permalink
fix(ui): deprecate keyboard input form
Browse files Browse the repository at this point in the history
  • Loading branch information
wolimst committed May 11, 2024
1 parent 6aac30b commit 925c861
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 20 deletions.
1 change: 0 additions & 1 deletion src/components/nav/Config.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
<Toggle checked={$config.darkTheme} on:toggle={config.toggleTheme}>
다크 모드
</Toggle>
<Toggle bind:checked={$config.showInputForm}>키보드 입력 상자 표시</Toggle>
<Toggle bind:checked={$config.switchEnterAndBackspacePosition}>
<Badge>입력</Badge> 과 <Badge>삭제</Badge> 키 위치 바꾸기
</Toggle>
Expand Down
1 change: 1 addition & 0 deletions src/components/wordle/keyboard/InputForm.svelte
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- TODO: TO BE REMOVED - keyboard input form is deprecated -->
<script lang="ts">
import { getKeyboardErrorMessage } from '../message'
import { game, keyboard } from '../store'
Expand Down
17 changes: 0 additions & 17 deletions src/components/wordle/keyboard/Keyboard.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<script lang="ts">
import { getKeyboardErrorMessage } from '../message'
import { game, keyboard } from '../store'
import InputForm from './InputForm.svelte'
import Key from './Key.svelte'
import BackspaceIcon from '@/components/ui/icons/Backspace.svelte'
import * as Hangul from '@/lib/hangul'
Expand All @@ -19,8 +18,6 @@
const ENTER_KEY = 'Enter'
const BACKSPACE_KEY = 'Backspace'
let isFormFocused = false
function isJamoKey(key: string): key is Hangul.DubeolsikJamo {
return Hangul.getCodePointLength(key) === 1 && Hangul.isHangulJamo(key)
}
Expand All @@ -47,10 +44,6 @@
}
function handleKeyboardInputOutsideForm(event: KeyboardEvent) {
if (isFormFocused) {
return
}
const key: string =
Hangul.ALPHABET_JAMO_MAP_DUBEOLSIK[event.key] || event.key
onClick(key)
Expand All @@ -65,16 +58,6 @@
})
</script>

{#if $config.showInputForm}
<div class="tw-flex tw-flex-nowrap tw-justify-center tw-my-1.5 md:tw-my-3">
<InputForm
on:submit
on:focus={() => (isFormFocused = true)}
on:blur={() => (isFormFocused = false)}
/>
</div>
{/if}

<div
class="tw-flex tw-flex-nowrap tw-justify-center tw-gap-1.5 tw-my-1.5 md:tw-mt-3"
>
Expand Down
1 change: 0 additions & 1 deletion src/stores/app/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { get } from 'svelte/store'
const defaultConfig: Config = {
showHelpOnLaunch: true,
darkTheme: window.matchMedia('(prefers-color-scheme: dark)').matches,
showInputForm: false,
switchEnterAndBackspacePosition: false,
isBeingUpdated: false,
useShorterBox: false,
Expand Down
1 change: 0 additions & 1 deletion src/stores/app/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export interface Data {
export interface Config {
showHelpOnLaunch: boolean
darkTheme: boolean
showInputForm: boolean
switchEnterAndBackspacePosition: boolean
isBeingUpdated: boolean
useShorterBox: boolean
Expand Down

0 comments on commit 925c861

Please sign in to comment.