Skip to content

Commit

Permalink
Showing 14 changed files with 296 additions and 69 deletions.
26 changes: 5 additions & 21 deletions app/components/button.module.scss
Original file line number Diff line number Diff line change
@@ -6,19 +6,21 @@
justify-content: center;
padding: 10px;

box-shadow: var(--card-shadow);
cursor: pointer;
transition: all 0.3s ease;
overflow: hidden;
user-select: none;
}

.shadow {
box-shadow: var(--card-shadow);
}

.border {
border: var(--border-in-light);
}

.icon-button:hover {
filter: brightness(0.9);
border-color: var(--primary);
}

@@ -36,25 +38,7 @@
}
}

@mixin dark-button {
div:not(:global(.no-dark))>.icon-button-icon {
filter: invert(0.5);
}

.icon-button:hover {
filter: brightness(1.2);
}
}

:global(.dark) {
@include dark-button;
}

@media (prefers-color-scheme: dark) {
@include dark-button;
}

.icon-button-text {
margin-left: 5px;
font-size: 12px;
}
}
6 changes: 5 additions & 1 deletion app/components/button.tsx
Original file line number Diff line number Diff line change
@@ -7,17 +7,21 @@ export function IconButton(props: {
icon: JSX.Element;
text?: string;
bordered?: boolean;
shadow?: boolean;
className?: string;
title?: string;
}) {
return (
<div
className={
styles["icon-button"] +
` ${props.bordered && styles.border} ${props.className ?? ""}`
` ${props.bordered && styles.border} ${props.shadow && styles.shadow} ${
props.className ?? ""
} clickable`
}
onClick={props.onClick}
title={props.title}
role="button"
>
<div className={styles["icon-button-icon"]}>{props.icon}</div>
{props.text && (
6 changes: 5 additions & 1 deletion app/components/chat-list.tsx
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ import {
} from "../store";

import Locale from "../locales";
import { isMobileScreen } from "../utils";

export function ChatItem(props: {
onClick?: () => void;
@@ -61,7 +62,10 @@ export function ChatList() {
key={i}
selected={i === selectedIndex}
onClick={() => selectSession(i)}
onDelete={() => confirm(Locale.Home.DeleteChat) && removeSession(i)}
onDelete={() =>
(!isMobileScreen() || confirm(Locale.Home.DeleteChat)) &&
removeSession(i)
}
/>
))}
</div>
71 changes: 71 additions & 0 deletions app/components/chat.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
.prompt-toast {
position: absolute;
bottom: -50px;
z-index: 999;
display: flex;
justify-content: center;
width: calc(100% - 40px);

.prompt-toast-inner {
display: flex;
justify-content: center;
align-items: center;
font-size: 12px;
background-color: var(--white);
color: var(--black);

border: var(--border-in-light);
box-shadow: var(--card-shadow);
padding: 10px 20px;
border-radius: 100px;

.prompt-toast-content {
margin-left: 10px;
}
}
}

.context-prompt {
.context-prompt-row {
display: flex;
justify-content: center;
width: 100%;
margin-bottom: 10px;

.context-role {
margin-right: 10px;
}

.context-content {
flex: 1;
max-width: 100%;
text-align: left;
}

.context-delete-button {
margin-left: 10px;
}
}

.context-prompt-button {
flex: 1;
}
}

.memory-prompt {
margin-top: 20px;

.memory-prompt-title {
font-size: 12px;
font-weight: bold;
margin-bottom: 10px;
}

.memory-prompt-content {
background-color: var(--gray);
border-radius: 6px;
padding: 10px;
font-size: 12px;
user-select: text;
}
}
Loading

0 comments on commit b85245e

Please sign in to comment.