Skip to content

Commit

Permalink
chore: update web style and tailwind config
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnsonMao committed Jul 27, 2024
1 parent 56751f2 commit fb83c7c
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion components/shared/Chat/v2/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ export type ChatProps = {
lobbyMessages: MessageType[];
friendList: FriendType[];
roomMessages: MessageType[];
maxHeight?: string;
};

export default function Chat({
userId,
lobbyMessages,
friendList,
roomMessages,
maxHeight = "calc(100vh - 10rem)",
}: Readonly<ChatProps>) {
const [messages, setMessages] = useState(lobbyMessages);
const [target, setTarget] = useState<[ChatTab["id"], string | null]>([
Expand Down Expand Up @@ -70,7 +72,7 @@ export default function Chat({
return (
<div
className="w-[308px] h-[var(--chat-height))] gradient-purple rounded-lg"
style={{ "--chat-height": "calc(100vh - 10rem)" } as CSSProperties}
style={{ "--chat-height": maxHeight } as CSSProperties}
>
<div className="h-full body-bg border border-transparent bg-clip-padding rounded-lg overflow-hidden">
<ChatHeader
Expand Down
2 changes: 1 addition & 1 deletion components/shared/Chat/v2/ChatHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function ChatHeader({
)}
onClick={toggleTab(id)}
>
{notifications && (
{Number(notifications) > 0 && (
<span className="absolute right-0 -top-2 fz-12 w-4 h-4 leading-4 rounded-full bg-secondary-500 text-basic-white">
{notifications}
</span>
Expand Down
2 changes: 1 addition & 1 deletion components/shared/SearchBar/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const SearchBar = ({
{leftSlot}
<input
role="search"
className="py-2.5 px-4 leading-normal rounded-full bg-white/8 flex-1 text-primary-200"
className="py-2.5 px-4 leading-normal rounded-full bg-white/8 flex-1 text-primary-200 focus-within:outline-0"
placeholder={placeholder}
value={value}
onChange={(e) => setValue(e.target.value)}
Expand Down
2 changes: 1 addition & 1 deletion components/shared/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function Sidebar() {
];

return (
<nav className="flex flex-col shrink-0 justify-start bg-white/8 glass-shadow my-6 ms-1.5 py-6 rounded-2xl w-18 gap-5">
<nav className="flex flex-col justify-start bg-white/8 glass-shadow py-6 rounded-2xl w-18 h-full gap-5">
{buttons.map((ButtonProps) => (
<Link
href={ButtonProps.route}
Expand Down
2 changes: 1 addition & 1 deletion pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function Document() {
<meta name="og:title" content={siteTitle} />
<meta name="twitter:card" content="summary_large_image" />
</Head>
<body className="body-bg">
<body className="body-bg overflow-hidden">
<Main />
<NextScript />
</body>
Expand Down
1 change: 1 addition & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = {
content: [
"./pages/**/*.{js,ts,jsx,tsx}",
"./components/**/*.{js,ts,jsx,tsx}",
"./containers/**/*.{js,ts,jsx,tsx}",
],
theme: {
fontFamily: {
Expand Down

0 comments on commit fb83c7c

Please sign in to comment.