Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: updated to daisyui 3.1.0 #509

Merged
merged 31 commits into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
5ed1205
update daisyui and chnage drawer
sitaradev Jun 6, 2023
fe72ac3
drawer fixes
sitaradev Jun 7, 2023
c181b54
replace bg-base-200 with bg-neutral
sitaradev Jun 7, 2023
442bd68
sidebar padding fixes
sitaradev Jun 7, 2023
a2dbd9c
channel drawer fixes
sitaradev Jun 8, 2023
77bed98
update drawer content container
sitaradev Jun 8, 2023
ee6a4f8
drawer z index updates
sitaradev Jun 8, 2023
21adbea
user item and dropdown color change
sitaradev Jun 8, 2023
edbb24a
channel drawer padding p-5
sitaradev Jun 8, 2023
c4e163a
item channel card updates
sitaradev Jun 8, 2023
5a40343
update color config
sitaradev Jun 8, 2023
41ac23a
temporary tooltip fixes
sitaradev Jun 8, 2023
5c75e40
fiex small drawer
sitaradev Jun 8, 2023
ca7afbd
fixed chat drawer ui
sitaradev Jun 8, 2023
43e621d
channel screen fiexs and revert some color classes
sitaradev Jun 8, 2023
496cc79
search box update
sitaradev Jun 9, 2023
90ea256
Fix: profile channels showing other channels
gagansuie Jun 9, 2023
943769e
Merge pull request #506 from gagan-suie/dev
gagansuie Jun 9, 2023
0fab232
Merge remote-tracking branch 'upstream/dev' into pr/505
gagansuie Jun 9, 2023
9c624d8
Fix: infinite scrolling on profile channels
gagansuie Jun 9, 2023
0f9bf0b
Fix: daisyUI 3.0.0 changes
gagansuie Jun 10, 2023
b3ed18a
Fix: carousel viewers btn color
gagansuie Jun 10, 2023
4e5b62d
edit category drawer height fix
sitaradev Jun 12, 2023
7e5c3cb
chat mobile vesrion fixes
sitaradev Jun 12, 2023
e18548f
btn-square applied for chevron
sitaradev Jun 12, 2023
25373b8
remove blac bg tooltip
sitaradev Jun 12, 2023
443ccf1
change item hover
sitaradev Jun 12, 2023
0211594
Fix: minor padding changes
gagansuie Jun 12, 2023
a7eb1b3
Merge pull request #505 from sitaradev/update-daisyui
gagansuie Jun 12, 2023
4f45cc6
Feat: updated version
gagansuie Jun 12, 2023
0c402c7
Merge pull request #508 from gagan-suie/dev
gagansuie Jun 12, 2023
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mage-website",
"version": "0.0.3",
"version": "0.0.4",
"license": "GPL-3.0",
"private": true,
"type": "module",
Expand Down Expand Up @@ -53,7 +53,7 @@
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/typography": "^0.5.9",
"animate.css": "^4.1.1",
"daisyui": "^2.52.0",
"daisyui": "^3.1.0",
"nprogress": "^0.2.0",
"playwright-e2e-coverage-report": "^1.0.28",
"svelte-tags-input": "^5.0.0",
Expand Down
6 changes: 5 additions & 1 deletion src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
html {
font-family: 'Montserrat', sans-serif;
}
}
}
/* temporary fix */
.tooltip:before {
color: white;
}
134 changes: 68 additions & 66 deletions src/lib/components/Browse/DrawerAddCategory.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -88,78 +88,80 @@
})
</script>

<div class="bg-base-200 rounded-lg w-80 md:w-[30rem] flex flex-col {classes}">
<p class="p-3 text-xl mb-5 pb-2 border-purple-500 font-semibold border-b-2">Select category</p>
<div class="flex flex-col p-3 h-full">
<div class="relative">
<div class="flex gap-1 input input-primary">
<div class="flex flex-row gap-2 items-center left-0">
{#if categories?.length}
{#each categories as icon}
<img
src={$category_list[icon]}
alt=""
class="h-5 w-5 cursor-pointer"
on:click={() => removeCategory(icon)} />
{/each}
{/if}
</div>
<div class="flex h-full p-5">
<div class="bg-base-200 rounded-lg w-80 md:w-[30rem] flex flex-col {classes}">
<p class="p-3 text-xl mb-5 pb-2 border-purple-500 font-semibold border-b-2">Select category</p>
<div class="flex flex-col p-3 h-full">
<div class="relative">
<div class="flex gap-1 input input-primary">
<div class="flex flex-row gap-2 items-center left-0">
{#if categories?.length}
{#each categories as icon}
<img
src={$category_list[icon]}
alt=""
class="h-5 w-5 cursor-pointer"
on:click={() => removeCategory(icon)} />
{/each}
{/if}
</div>

<input
type="text"
bind:value={searchQuery}
on:input={() => searchCategory()}
name=""
class="grow md:ml-4 md:mr-12 focus:outline-0 max-w-[8rem] bg-base-100 md:max-w-xs"
placeholder={categories?.length ? '' : 'Category'}
autocomplete="off" />
<input
type="text"
bind:value={searchQuery}
on:input={() => searchCategory()}
name=""
class="grow md:ml-4 md:mr-12 focus:outline-0 max-w-[8rem] bg-base-100 md:max-w-xs"
placeholder={categories?.length ? '' : 'Category'}
autocomplete="off" />
</div>
<span class="absolute right-0 top-1/4 text-gray-400 pr-3">({maxCategoryLabel})</span>
</div>
<span class="absolute right-0 top-1/4 text-gray-400 pr-3">({maxCategoryLabel})</span>
</div>

<div class="tabs tabs-boxed mt-5">
{#each tabs as tab}
<!-- svelte-ignore a11y-click-events-have-key-events -->
<span class="tab" class:tab-active={activeTab == tab} on:click={() => setActiveTab(tab)}
>{tab}</span>
{/each}
</div>

<div class="flex flex-col grow h-80 overflow-y-scroll mt-5">
{#if renderingAssets.length}
{#each renderingAssets as [name, image_url]}
<div class="tabs tabs-boxed mt-5">
{#each tabs as tab}
<!-- svelte-ignore a11y-click-events-have-key-events -->
<label
class="cursor-pointer flex items-center gap-2 pb-2"
on:click={() => toggleCategory(name, image_url)}>
<input
type="checkbox"
checked={categories.includes(name)}
class="checkbox checkbox-primary"
disabled={categories.length === maxCategory && !categories.includes(name)} />
<img src={image_url} alt="" class="h-7 w-7 m-1" />
<span class="label-text">{name}</span>
</label>
<span class="tab" class:tab-active={activeTab == tab} on:click={() => setActiveTab(tab)}
>{tab}</span>
{/each}
{:else if searchQuery != ''}
<div class="alert flex justify-center">
<IconInfo />
<p>No results for the search query</p>
</div>
{:else}
<div class="flex justify-center w-full">
<progress class="progress w-full" />
</div>
{/if}
</div>

<div class="flex flex-col grow h-80 overflow-y-scroll mt-5">
{#if renderingAssets.length}
{#each renderingAssets as [name, image_url]}
<!-- svelte-ignore a11y-click-events-have-key-events -->
<label
class="cursor-pointer flex items-center gap-2 pb-2"
on:click={() => toggleCategory(name, image_url)}>
<input
type="checkbox"
checked={categories.includes(name)}
class="checkbox checkbox-primary"
disabled={categories.length === maxCategory && !categories.includes(name)} />
<img src={image_url} alt="" class="h-7 w-7 m-1" />
<span class="label-text">{name}</span>
</label>
{/each}
{:else if searchQuery != ''}
<div class="alert flex justify-center">
<IconInfo />
<p>No results for the search query</p>
</div>
{:else}
<div class="flex justify-center w-full">
<progress class="progress w-full" />
</div>
{/if}
</div>
</div>
</div>

<div class="flex flex-row mt-auto gap-2 md:mb-4 p-3">
<button
type="button"
class="btn btn-default grow"
on:click={() => ((categories = []), (showAddCategory = false))}>Cancel</button>
<button type="button" class="btn btn-primary grow" on:click={() => (showAddCategory = false)}
>Add</button>
<div class="flex flex-row mt-auto gap-2 md:mb-4 p-3">
<button
type="button"
class="btn btn-neutral text-white grow"
on:click={() => ((categories = []), (showAddCategory = false))}>Cancel</button>
<button type="button" class="btn btn-primary grow" on:click={() => (showAddCategory = false)}
>Add</button>
</div>
</div>
</div>
17 changes: 7 additions & 10 deletions src/lib/components/Browse/DrawerCreateChannel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
<DrawerAddCategory bind:showAddCategory bind:categories={newChannel.category} />
{:else}
<form
class="flex m-5"
class="flex h-full p-5"
action="?/create-channel"
method="post"
use:enhance={({ data }) => {
Expand Down Expand Up @@ -204,21 +204,18 @@
on:invalid={onValidation} />
{/if}
</div>
<!-- <div class="flex flex-row mt-5 ">
<input
bind:checked={newChannel.isPrivate}
type="checkbox"
class="checkbox checkbox-primary mr-3" /> Private
</div> -->
</div>

<div class="flex flex-row gap-2 mt-auto md:mb-4 p-3">
<button type="button" class="btn btn-default grow" on:click={() => toggleDrawer()}
>Cancel</button>
<button
type="button"
class="btn btn-neutral text-white grow"
on:click={() => toggleDrawer()}>Cancel</button>
<button
type="submit"
disabled={isLoadingChannel}
class="btn btn-primary grow {isLoadingChannel ? 'loading' : ''}">Add</button>
class="btn btn-primary text-white grow {isLoadingChannel ? 'loading' : ''}"
>Add</button>
</div>
</div>
</form>
Expand Down
5 changes: 3 additions & 2 deletions src/lib/components/Browse/SearchBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
type="search"
placeholder="Search channels"
class="input input-bordered input-primary w-96" />
<button class="btn btn-square">
<button class="btn btn-square btn-neutral text-white">
<IconSearch />
</button>
</div>
Expand All @@ -38,7 +38,8 @@
}
}}>
<IconCreate />
Create a channel</label>
Create a channel
</label>
</div>

{#if showDrawer}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Browse/Sections/ItemCarousel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<div class="dropdown dropdown-bottom">
<label
for=""
class="btn btn-sm rounded-md font-medium gap-2 text-white border-none"
class="btn btn-sm rounded-md font-medium gap-2 btn-neutral text-white border-none"
tabindex="-1">
<IconViewers />
{channel.memberCount || '0'}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/Browse/Sections/ItemChannel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
export let channel: any = {}
</script>

<ul class="menu shrink-0 mt-6 bg-base-100 rounded-md">
<ul class="p-4 bg-base-100 hover:bg-base-300 shrink-0 mt-6 rounded-md">
<li>
<a
class="flex flex-col w-[20rem] md:w-[25rem] rounded-md items-stretch"
Expand All @@ -22,7 +22,7 @@
<div class="dropdown dropdown-bottom">
<label
for=""
class="btn btn-sm rounded-md font-medium gap-2 text-white border-none"
class="btn btn-sm rounded-md font-medium gap-2 btn-neutral text-white border-none"
tabindex="-1">
<IconViewers />
{channel.memberCount || '0'}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Browse/Sections/ItemUser.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
export let user: any = {}
</script>

<ul class="menu shrink-0 bg-base-100 rounded-md">
<ul class="p-4 bg-base-100 hover:bg-base-300 shrink-0 rounded-md">
<li>
<a class="rounded-md" href="/profile/{user.username}">
<div class="text-center space-y-3 w-[200px]">
Expand Down
6 changes: 3 additions & 3 deletions src/lib/components/Browse/Sections/SectionCarousel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

onMount(async () => {
channels.then((data: any) => {
if(data.length){
if (data.length) {
initSwiper()
isMounted = true
}
Expand All @@ -60,7 +60,7 @@
{:then value}
{#if value?.length > 0}
<div class={'relative p-1 transition-opacity ease-in duration-100 ' + swiperClass}>
<div class="btn btn-square p-2 btn-prev absolute top-2/4 left-1 z-10 ml-3">
<div class="btn btn-neutral text-white p-2 btn-prev btn-square absolute top-2/4 left-1 z-10 ml-3">
<IconDrawerLeft />
</div>
<div class="swiper carousel !pt-10 mx-8">
Expand All @@ -70,7 +70,7 @@
{/each}
</div>
</div>
<div class="btn btn-square z-10 p-2 btn-next absolute top-2/4 right-1 mr-3">
<div class="btn btn-neutral text-white z-10 p-2 btn-next btn-square absolute top-2/4 right-1 mr-3">
<IconDrawerChevron />
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/Browse/Sections/SectionChannel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</div>
<div class="flex flex-row">
<div class="relative flex items-center ml-3">
<div class="absolute btn btn-square p-2 left-0 z-10" on:click={prev}>
<div class="absolute btn btn-neutral btn-prev btn-square text-white p-2 left-0 z-10" on:click={prev}>
<IconDrawerLeft />
</div>
</div>
Expand All @@ -69,7 +69,7 @@
</div>

<div class="relative flex items-center mr-3">
<div class="absolute btn btn-square p-2 right-0 z-10" on:click={next}>
<div class="absolute btn btn-neutral btn-next btn-square text-white p-2 right-0 z-10" on:click={next}>
<IconDrawerChevron />
</div>
</div>
Expand Down
8 changes: 5 additions & 3 deletions src/lib/components/Browse/Sections/SectionTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
import LastItemInViewport from '$lib/actions/LastItemInViewport'
import { get } from '$lib/api'

export let channels: any = []
export let channels: any = [],
profileId: string = ''

let skip = 100
let limit = 100
let moreChannels: any[] = []
async function loadMore(): Promise<void> {
const infiniteChannels = await get(`channels?skip=${skip}&limit=${limit}`)
const loadMore = async () => {
let endpoint = profileId ? `channels/user?userId=${profileId}?` : 'channels?'
const infiniteChannels = await get(`${endpoint}skip=${skip}&limit=${limit}`)
if (infiniteChannels?.length) {
moreChannels = [...moreChannels, ...infiniteChannels]
skip += limit
Expand Down
8 changes: 6 additions & 2 deletions src/lib/components/Browse/Sections/SectionUser.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
</div>
<div class="flex flex-row">
<div class="relative flex items-center ml-3">
<div class="absolute btn btn-square p-2 left-0 z-10" on:click={prev}>
<div
class="absolute btn btn-square btn-neutral text-white p-2 left-0 z-10"
on:click={prev}>
<IconDrawerLeft />
</div>
</div>
Expand All @@ -62,7 +64,9 @@
</div>

<div class="relative flex items-center mr-3">
<div class="absolute btn btn-square p-2 right-0 z-10" on:click={next}>
<div
class="absolute btn btn-square btn-neutral text-white p-2 right-0 z-10"
on:click={next}>
<IconDrawerChevron />
</div>
</div>
Expand Down
18 changes: 13 additions & 5 deletions src/lib/components/Channel/Chat/ChatInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -163,28 +163,36 @@

<form class="rounded-lg bg-base-200 p-2 w-full relative">
<button
class="btn tooltip font-normal normal-case {!isHost
class="btn text-white border-none tooltip font-normal normal-case {!isHost
? 'no-animation'
: ''} {channel.isAiChatEnabled ? 'btn-primary' : ''}"
: ''} {channel.isAiChatEnabled ? 'btn-primary' : 'btn-neutral'}"
data-tip="AI"
on:click={() => {
if (isHost) toggleAIChat()
}}>
<IconChatAI />
<span class="sr-only">Enable AI</span>
</button>
<button disabled type="button" class="btn tooltip font-normal normal-case" data-tip="Emoji">
<button
disabled
type="button"
class="btn btn-neutral text-white border-none tooltip font-normal normal-case"
data-tip="Emoji">
<IconChatEmoji />
<span class="sr-only">Add emoji</span>
</button>
<button disabled type="button" class="btn tooltip font-normal normal-case" data-tip="GIF">
<button
disabled
type="button"
class="btn btn-neutral text-white border-none tooltip font-normal normal-case"
data-tip="GIF">
<IconChatGif />
<span class="sr-only">Add GIF</span>
</button>
<button
disabled
type="button"
class="btn tooltip font-normal normal-case"
class="btn btn-neutral text-white border-none tooltip font-normal normal-case"
data-tip="Code snippet">
<IconChatCode />
<span class="sr-only">Add code snippet</span>
Expand Down
Loading