Skip to content

Commit

Permalink
Merge pull request #81 from zamm-dev/send-button-icon
Browse files Browse the repository at this point in the history
Use icon for chat send button
  • Loading branch information
amosjyng authored May 10, 2024
2 parents 301b4a2 + 7398388 commit f655358
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 3 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src-svelte/src/lib/controls/Button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
export let unwrapped = false;
export let rightEnd = false;
export let ariaLabel: string | undefined = undefined;
const dispatchClickEvent = createEventDispatcher();
function handleClick() {
Expand All @@ -15,6 +16,7 @@
class="cut-corners inner"
class:right-end={rightEnd}
type="submit"
aria-label={ariaLabel}
on:click={handleClick}
>
<slot />
Expand All @@ -24,6 +26,7 @@
class="cut-corners outer"
class:right-end={rightEnd}
type="submit"
aria-label={ariaLabel}
on:click={handleClick}
>
<div class="cut-corners inner" class:right-end={rightEnd}>
Expand Down
11 changes: 10 additions & 1 deletion src-svelte/src/routes/chat/Form.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import autosize from "autosize";
import Button from "$lib/controls/Button.svelte";
import IconSend from "~icons/gravity-ui/arrow-right";
import { onMount } from "svelte";
export let sendChatMessage: (message: string) => void;
Expand Down Expand Up @@ -51,7 +52,7 @@
bind:this={textareaInput}
bind:value={currentMessage}
/>
<Button unwrapped rightEnd>Send</Button>
<Button ariaLabel="Send" unwrapped rightEnd><IconSend /></Button>
</form>

<style>
Expand All @@ -73,4 +74,12 @@
max-height: 9.8rem;
resize: none;
}
form :global(button) {
width: 4rem;
min-height: 2rem;
display: flex;
justify-content: center;
align-items: center;
}
</style>
2 changes: 1 addition & 1 deletion src-svelte/src/routes/credits/Creditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@
img {
width: 2rem;
border-radius: var(--corner-roundness);
}
img.person {
width: 2.5rem;
border-radius: var(--corner-roundness);
}
.logo-placeholder,
Expand Down
5 changes: 5 additions & 0 deletions src-svelte/src/routes/credits/Credits.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@
logo="vaadin.svg"
url="https://vaadin.com/"
/>
<Creditor
name="Gravity UI"
logo="gravity-ui.png"
url="https://gravity-ui.com/"
/>
</Grid>
</SubInfoBox>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src-svelte/src/routes/storybook.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ const components: ComponentTestConfig[] = [
name: "new-message-sent",
prefix: "extra-long-input",
additionalAction: async (frame: Frame) => {
await frame.click('button:has-text("Send")');
await frame.click('button[aria-label="Send"]');
await frame.click('button[title="Dismiss"]');
},
},
Expand Down
Binary file added src-svelte/static/logos/gravity-ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified webdriver/screenshots/baseline/desktop_wry/chat-screen-800x600.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 f655358

Please sign in to comment.