Skip to content

Commit

Permalink
feat: adjust quick settings position
Browse files Browse the repository at this point in the history
  • Loading branch information
sunls24 committed Nov 22, 2024
1 parent 1f1fd85 commit a55d549
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 37 deletions.
3 changes: 3 additions & 0 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ import { Card } from "@/components/ui/card";
import { Separator } from "@/components/ui/separator";
import Header from "@/components/header";
import Chat from "@/components/chat";
import SettingsQuick from "@/components/settings/settings-quick";

export default function Page() {
return (
<main className="h-full pt-[13px]">
<Card className="mx-auto flex h-full w-[95%] max-w-5xl flex-col">
<Header />
<Separator />
<SettingsQuick />
<Separator />
<Chat />
</Card>
</main>
Expand Down
2 changes: 0 additions & 2 deletions components/chat-body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import Dividers from "@/components/dividers";
import { emitter, mittKey } from "@/lib/mitt";
import { ScrollArea } from "@/components/ui/scroll-area";
import { Loader } from "lucide-react";
import SettingsQuick from "@/components/settings/settings-quick";

function ChatBody({
isLoading,
Expand Down Expand Up @@ -84,7 +83,6 @@ function ChatBody({
viewportClass="p-2 sm:p-4"
onScroll={(e) => onScroll(e.currentTarget)}
>
<SettingsQuick />
{messages.map((value, index) => {
return (
<div key={value.id}>
Expand Down
2 changes: 1 addition & 1 deletion components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Separator } from "@/components/ui/separator";

function Header() {
return (
<header className="flex h-12 items-center gap-1 px-4">
<header className="flex h-12 items-center gap-1 pl-4 pr-2">
<HeaderTopic />
<ChatList
trigger={
Expand Down
21 changes: 6 additions & 15 deletions components/settings/settings-quick.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
"use client";
import React from "react";
import { Card } from "@/components/ui/card";
import SettingsModel from "@/components/settings/settings-model";
import { Separator } from "@/components/ui/separator";
import SettingsTemperature from "@/components/settings/settings-temperature";
import SettingsGoogle from "@/components/settings/settings-google";
import { Settings2 } from "lucide-react";

function SettingsQuick() {
return (
<Card className="mb-3 flex flex-col gap-4 p-4">
<div className="flex items-center gap-1">
<Settings2 size={20} strokeWidth={1.8} />
<h3 className="font-medium">快捷设置</h3>
</div>
<Separator />
<div className="flex flex-col gap-4 md:flex-row md:justify-between">
<SettingsModel className="md:max-w-xs md:flex-1" />
<SettingsTemperature className="md:max-w-xs md:flex-1" />
<SettingsGoogle className="md:w-[180px]" />
</div>
</Card>
<div className="flex flex-col gap-1 px-4 pb-1 pt-2 md:flex-row md:justify-between md:gap-4 md:py-3">
<SettingsModel className="md:max-w-xs md:flex-1" />
<SettingsTemperature className="md:max-w-xs md:flex-1" />
<SettingsGoogle className="md:w-[180px]" />
</div>
);
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"mitt": "^3.0.1",
"next": "^15.0.3",
"next-themes": "^0.3.0",
"openai": "^4.72.0",
"openai": "^4.73.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-markdown": "8.0.7",
Expand Down
36 changes: 18 additions & 18 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a55d549

Please sign in to comment.