Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions apps/frontend/src/components/Devtools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { TanStackRouterDevtoolsPanel } from '@tanstack/react-router-devtools'
import { TanStackDevtools } from '@tanstack/react-devtools'

import TanStackQueryDevtools from '../integrations/tanstack-query/devtools'
import { Oddy } from './oddy'

/**
* Developer tools are loaded from a separate chunk that is only requested in
Expand All @@ -10,17 +11,20 @@ import TanStackQueryDevtools from '../integrations/tanstack-query/devtools'
*/
export default function Devtools() {
return (
<TanStackDevtools
config={{
position: 'bottom-right',
}}
plugins={[
{
name: 'Tanstack Router',
render: <TanStackRouterDevtoolsPanel />,
},
TanStackQueryDevtools,
]}
/>
<div>
<TanStackDevtools
config={{
position: 'bottom-right',
}}
plugins={[
{
name: 'Tanstack Router',
render: <TanStackRouterDevtoolsPanel />,
},
TanStackQueryDevtools,
]}
/>
<Oddy/>
</div>
)
}
12 changes: 12 additions & 0 deletions apps/frontend/src/components/oddy.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

.spinSlow {
animation: spin 3s linear infinite;
}
Binary file added apps/frontend/src/components/oddy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions apps/frontend/src/components/oddy.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
"use client"

import oddy from "./oddy.png"
import styles from "./oddy.module.css"

type OddyProps = {
message?: string
onClick?: () => void
isFrog?: boolean
isPride?: boolean
}

export const Oddy = ({
message = "Hei! Jeg er Oddy, kan jeg hjelpe deg med noe?",
onClick,
isFrog = false,
isPride = false,
}: OddyProps) => {

let name: "Oddy"
return (
<div
id="chat-container"
className="flex flex-col items-end gap-3 z-40 fixed bottom-6 right-6"
>
<button type="button" onClick={onClick} className="cursor-pointer">
<img
src={oddy}
alt={'oddy'}
width={80}
height={80}
className={`rounded-full ${isFrog ? styles.spinSlow : ""}`}
/>
</button>

<button
id="oddy_container"
className="relative px-4 py-3 rounded-lg cursor-pointer"
type="button"
onClick={onClick}
>
<div className="relative bg-gray-200 px-4 py-3 rounded-lg text-gray-900 shadow">
{isFrog
? message.replace(
/\bOddy\b/g,
isPride ? "Pride Froggy 🏳️‍🌈" : "Froggy",
)
: message}
<div className="absolute top-[-8px] right-4 w-0 h-0 border-l-8 border-r-8 border-b-8 border-transparent border-b-gray-200" />
</div>
</button>
</div>
)
}

Loading