Skip to content

Commit

Permalink
many small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lassejaco committed Oct 30, 2024
1 parent caeb8d9 commit 8f49134
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 19 deletions.
3 changes: 2 additions & 1 deletion devcon-app/src/components/domain/app/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { AccountContext, useAccountContext } from 'context/account-context'
import { useIsScrolled } from 'hooks/useIsScrolled'
import ArrowBackIcon from 'assets/icons/arrow_left.svg'
import { selectedSpeakerAtom } from 'pages/_app'
import account from 'pages/account'

type HeaderProps = {
breadcrumbs: {
Expand Down Expand Up @@ -467,7 +468,7 @@ const Navigation = () => {
</PopoverTrigger>

<PopoverContent className="w-auto p-1 text-sm px-2" side={isSmallScreen ? 'top' : 'left'} sideOffset={10}>
<div>{true ? 'App' : 'AI Chat'}</div>
<div>{accountContext.account ? 'Ask Deva + Notifications' : 'Ask Deva'}</div>
{/* <PopoverArrow style={{ fill: 'white' }} /> */}
</PopoverContent>
</Popover>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ export const NotificationCard = (props: any) => {
<div className="flex justify-between gap-0 border border-solid border-gray-200 rounded-lg p-2 w-full bg-white mb-2 relative">
<div className="flex flex-col gap-2">
<p className="text-sm semi-bold pr-10">{notification.title}</p>
<p className="text-sm text-[#717784]">{notification.message}</p>
<p className="text-sm text-[#717784] pr-4">{notification.message}</p>
</div>
<div className="flex flex-col gap-1 shrink-0 items-end absolute right-2 top-2">
<p className="text-xs text-[#7D52F4] shrink-0 font-semibold">{getTimeAgo(notification.sendAt)}</p>
{isNew && <div className="text-[#7D52F4] h-[12px] flex items-center justify-center text-lg"></div>}
{isNew && <div className="text-[#7D52F4] h-[12px] flex items-center justify-center text-base"></div>}
</div>
</div>
)
Expand Down
68 changes: 58 additions & 10 deletions devcon-app/src/components/domain/app/dc7/sessions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ const TrackTag = ({ track, className, applyColor = true, ...rest }: any) => {
return (
<div
className={cn(
'text-[10px] text-black rounded-full px-2 py-0.5 font-semibold border border-solid border-[#E1E4EA] flex gap-2 items-center',
applyColor ? getTrackColor(track) : '',
'text-[10px] rounded-full px-2 py-0.5 font-semibold border border-solid border-[#E1E4EA] flex gap-2 items-center',
applyColor ? `${getTrackColor(track)} text-black` : '',
className
)}
{...rest}
Expand Down Expand Up @@ -431,6 +431,13 @@ export const SessionCard = ({ session, className }: { session: SessionType; clas
)
}

const filterTagClass = (selected: boolean) => {
return cn(
'flex shrink-0 text-xs items-center justify-center align-middle rounded-full border bg-white hover:bg-[#f8f7ff] border-solid border-transparent shadow px-4 py-1 cursor-pointer select-none transition-all duration-300',
selected && '!bg-[#EFEBFF] !fill-[#7D52F4] border border-solid border-[#cdbaff]'
)
}

export const SessionFilterAdvanced = ({ filterOptions }: { filterOptions: any }) => {
const [sessionFilter, setSessionFilter] = useRecoilState(sessionFilterAtom)
const [sessionFilterOpen, setSessionFilterOpen] = useRecoilState(sessionFilterOpenAtom)
Expand All @@ -449,12 +456,25 @@ export const SessionFilterAdvanced = ({ filterOptions }: { filterOptions: any })
return (
<div className="flex flex-col gap-4 p-4">
<div>
<div className="flex flex-col gap-3 pb-4 font-semibold">Session Type</div>
<div className="flex justify-between gap-3 pb-4 font-semibold">
<div>Type</div>
<div
onClick={() => {
setSessionFilter({
...sessionFilter,
type: {},
})
}}
className={tagClassTwo(false, ' !text-[black] font-semibold')}
>
Reset
</div>
</div>
<div className="flex flex-wrap gap-2">
{filterOptions.type.map((type: string) => (
<div
key={type}
className={tagClass(sessionFilter.type[type]) + ' !text-black font-semibold !shrink'}
className={cn(filterTagClass(sessionFilter.type[type]), '!shrink')}
onClick={() => toggleFilter('type', type)}
>
{type}
Expand All @@ -464,15 +484,29 @@ export const SessionFilterAdvanced = ({ filterOptions }: { filterOptions: any })
</div>

<div>
<div className="flex flex-col gap-3 pb-4 font-semibold">Tracks</div>
<div className="flex justify-between gap-3 pb-4 font-semibold">
<div>Tracks</div>
<div
onClick={() => {
setSessionFilter({
...sessionFilter,
track: {},
})
}}
className={tagClassTwo(false, ' font-semibold')}
>
Reset
</div>
</div>
<div className="flex flex-wrap gap-2">
{filterOptions.track.map((track: string) => (
<TrackTag
key={track}
track={track}
applyColor={sessionFilter.track[track]}
applyColor={sessionFilter.track[track] || false}
// className="!shrink"
className={tagClass(sessionFilter.track[track]) + ' !shrink'}
// className={tagClass(sessionFilter.track[track]) + ' !shrink'}
className={cn(tagClass(sessionFilter.track[track]), '!shrink')}
onClick={() => toggleFilter('track', track)}
>
{track}
Expand All @@ -482,12 +516,26 @@ export const SessionFilterAdvanced = ({ filterOptions }: { filterOptions: any })
</div>

<div>
<div className="flex flex-col gap-3 pb-4 font-semibold">Expertise</div>
<div className="flex justify-between gap-3 pb-4 font-semibold">
Expertise
<div
onClick={() => {
setSessionFilter({
...sessionFilter,
expertise: {},
})
}}
className={tagClassTwo(false, ' !text-[black] font-semibold')}
>
Reset
</div>
</div>
<div className="flex flex-wrap gap-2">
{filterOptions.expertise.map((expertise: string) => (
<div
key={expertise}
className={tagClass(sessionFilter.expertise[expertise]) + ' !text-black font-semibold !shrink'}
// className={tagClass(sessionFilter.expertise[expertise]) + ' !text-black font-semibold !shrink'}
className={cn(filterTagClass(sessionFilter.expertise[expertise]), '!shrink')}
onClick={() => toggleFilter('expertise', expertise)}
>
{expertise}
Expand Down Expand Up @@ -525,7 +573,7 @@ export const SessionFilterAdvanced = ({ filterOptions }: { filterOptions: any })
}}
className={tagClassTwo(false, ' !text-[black] font-semibold')}
>
Reset Filter
Reset All
</div>
</div>

Expand Down
10 changes: 5 additions & 5 deletions devcon-app/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ const Index = (props: any) => {

<Dashboard {...props} sessions={sessions} />

<div
{/* <div
className={cn(
'fixed top-0 left-0 h-full w-full justify-center items-center opacity-90 bg-white z-5 pointer-events-none flex flex-col gap-2 transition-opacity duration-500',
sessions && 'opacity-0'
)}
>
<FancyLoader loading={!sessions} />
Fetching schedule data...
</div>
> */}
{/* <FancyLoader loading={!sessions} /> */}
{/* Fetching schedule data...
</div> */}
</AppLayout>
)
}
Expand Down
8 changes: 7 additions & 1 deletion lib/components/ai/overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ const DevaBot = ({
setActiveTab(1);
setDefaultPrompt && setDefaultPrompt("");
} else {
setActiveTab(0);
setQuery(defaultPrompt);
}
}
Expand Down Expand Up @@ -596,7 +597,12 @@ const DevaBot = ({
const session = sessions.find(
(s: any) => s.id === sessionId
);
if (session) {
if (
session &&
!referencesTracker[sessionId]
) {
referencesTracker[sessionId] =
true;
sessionReferences.push(
SessionComponent ? (
// @ts-ignore
Expand Down

0 comments on commit 8f49134

Please sign in to comment.