Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #25 from palavrapasse/23-feat-show-illustration-wh…
Browse files Browse the repository at this point in the history
…en-user-is-typing

feat: show illustration when user is typing
  • Loading branch information
freitzzz authored Feb 12, 2023
2 parents 5e32f0a + 35efeae commit a4707a9
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/i18n/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ const en: Translation = {
leakSearchHint: '(compose emails with commas)',
loadingState: 'Searching...',
failureState: 'Oops... Something went wrong (500)',
throttledState: 'Hold on, my back hurts! (429)'
throttledState: 'Hold on, my back hurts! (429)',
editingState: 'Go on, I will be here to assist you once you finish your search.'
};

export default en;
8 changes: 8 additions & 0 deletions src/i18n/i18n-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ type RootTranslation = {
* C​a​l​m​a​,​ ​a​s​s​i​m​ ​f​i​c​o​ ​c​a​n​s​a​d​o​!​ ​(​4​2​9​)
*/
throttledState: string;
/**
* F​o​r​ç​a​,​ ​a​s​s​i​m​ ​q​u​e​ ​t​e​r​m​i​n​a​r​e​s​ ​a​ ​p​e​s​q​u​i​s​a​ ​e​s​t​a​r​e​i​ ​a​q​u​i​ ​p​a​r​a​ ​t​e​ ​a​j​u​d​a​r​!
*/
editingState: string;
};

export type TranslationFunctions = {
Expand Down Expand Up @@ -183,6 +187,10 @@ export type TranslationFunctions = {
* Calma, assim fico cansado! (429)
*/
throttledState: () => LocalizedString;
/**
* Força, assim que terminares a pesquisa estarei aqui para te ajudar!
*/
editingState: () => LocalizedString;
};

export type Formatters = {};
3 changes: 2 additions & 1 deletion src/i18n/pt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const pt: BaseTranslation = {
leakSearchHint: '(utiliza a virgula se quiseres procurar por mais que um e-mail)',
loadingState: 'Pesquisando...',
failureState: 'Oops... Algo de errado não está certo (500)',
throttledState: 'Calma, assim fico cansado! (429)'
throttledState: 'Calma, assim fico cansado! (429)',
editingState: 'Força, assim que terminares a pesquisa estarei aqui para te ajudar!'
};

export default pt;
1 change: 1 addition & 0 deletions src/lib/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export { default as NopeIllustration } from './nope_illustration.svelte';
export { default as NotifyButton } from './notify_button.svelte';
export { default as QueryLeaksTable } from './query_leaks_table.svelte';
export { default as QueryLeaksTargetDropdown } from './query_leaks_target_dropdown.svelte';
export { default as ReadingIllustration } from './reading_illustration.svelte';
export { default as SearchingIllustration } from './searching_illustration.svelte';
export { default as SearchInput } from './search_input.svelte';
export { default as ThumbsUpIllustration } from './thumbs_up_illustration.svelte';
Expand Down
10 changes: 10 additions & 0 deletions src/lib/components/reading_illustration.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script lang="ts">
import { base } from '$app/paths';
</script>

<img
id="reading-illustration"
class="h-96"
src="{base}/svg/chubby_reading.svg"
alt="cartoonish character reading a book"
/>
6 changes: 5 additions & 1 deletion src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
QueryLeaksTargetDropdown,
SearchingIllustration,
FireIllustration,
NopeIllustration
NopeIllustration,
ReadingIllustration
} from '@components';
import { QueryLeaksStore } from '@stores';
import type { Target } from '@http';
Expand Down Expand Up @@ -99,6 +100,9 @@
<p>{$LL.throttledState()}</p>
{:else if !isEditing && affected.length === 0}
<HelloIllustration />
{:else}
<ReadingIllustration />
<p class="text-center">{$LL.editingState()}</p>
{/if}
</div>
</body>
1 change: 1 addition & 0 deletions static/svg/chubby_reading.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a4707a9

Please sign in to comment.