From 09c3668afd84805249a28175552dece9180625a2 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Wed, 9 Oct 2024 16:11:23 -0700 Subject: [PATCH] Add mobile layout --- src/app.css | 17 ++- src/app/components/InfoHandle.svelte | 7 +- src/app/components/InfoNostr.svelte | 7 +- src/app/components/InfoRelay.svelte | 7 +- src/app/components/MenuHome.svelte | 50 +++++++ src/app/components/MenuSettings.svelte | 47 ++++++ src/app/components/MenuSpaces.svelte | 136 ++++++++++++++++++ src/app/components/PrimaryNav.svelte | 15 +- src/app/components/RoomCreate.svelte | 11 +- src/app/components/SpaceAdd.svelte | 11 +- src/app/components/SpaceCreate.svelte | 11 +- src/app/components/SpaceCreateExternal.svelte | 11 +- src/app/components/SpaceInviteAccept.svelte | 9 +- src/app/components/SpaceJoin.svelte | 13 +- src/app/components/ThreadItem.svelte | 4 +- src/app/state.ts | 51 +++---- src/lib/components/CardButton.svelte | 2 +- src/lib/components/ModalHeader.svelte | 4 + src/lib/components/Page.svelte | 2 +- src/lib/components/PageBar.svelte | 17 +++ src/lib/components/PageHeader.svelte | 5 + src/lib/components/SecondaryNav.svelte | 2 +- src/routes/discover/+page.svelte | 7 +- src/routes/discover/themes/+page.svelte | 7 +- src/routes/home/[chat]/+page.svelte | 38 +++-- src/routes/home/chats/+page.svelte | 71 +++++++++ src/routes/home/people/+page.svelte | 4 +- src/routes/settings/about/+page.svelte | 2 +- src/routes/spaces/+page.svelte | 53 ------- src/routes/spaces/[nrelay]/+layout.svelte | 6 +- .../spaces/[nrelay]/[[room]]/+page.svelte | 20 ++- .../spaces/[nrelay]/calendar/+page.svelte | 16 +-- .../spaces/[nrelay]/threads/+page.svelte | 35 +++-- 33 files changed, 513 insertions(+), 185 deletions(-) create mode 100644 src/app/components/MenuHome.svelte create mode 100644 src/app/components/MenuSettings.svelte create mode 100644 src/app/components/MenuSpaces.svelte create mode 100644 src/lib/components/ModalHeader.svelte create mode 100644 src/lib/components/PageBar.svelte create mode 100644 src/lib/components/PageHeader.svelte create mode 100644 src/routes/home/chats/+page.svelte delete mode 100644 src/routes/spaces/+page.svelte diff --git a/src/app.css b/src/app.css index 254c36aa..491a5989 100644 --- a/src/app.css +++ b/src/app.css @@ -52,13 +52,20 @@ } .bg-alt, -.bg-alt .bg-alt .bg-alt { - @apply bg-base-100; +.bg-alt .bg-alt .bg-alt, +.hover\:bg-alt:hover, +.bg-alt .bg-alt .hover\:bg-alt:hover, +.bg-alt .bg-alt.hover\:bg-alt:hover { + @apply bg-base-100 transition-colors; } .bg-alt .bg-alt, -.bg-alt .bg-alt .bg-alt .bg-alt { - @apply bg-base-300; +.bg-alt .bg-alt .bg-alt .bg-alt, +.bg-alt .hover\:bg-alt:hover, +.bg-alt .bg-alt .bg-alt .hover\:bg-alt:hover, +.bg-alt.hover\:bg-alt:hover, +.bg-alt .bg-alt .bg-alt.hover\:bg-alt:hover { + @apply bg-base-300 transition-colors; } .card2 { @@ -78,7 +85,7 @@ } .content { - @apply m-auto w-full max-w-3xl p-12; + @apply m-auto w-full max-w-3xl p-4 sm:p-8 md:p-12; } .heading { diff --git a/src/app/components/InfoHandle.svelte b/src/app/components/InfoHandle.svelte index f554a6d2..2b3d154f 100644 --- a/src/app/components/InfoHandle.svelte +++ b/src/app/components/InfoHandle.svelte @@ -1,12 +1,13 @@
-
-

What is a nostr address?

-
+ +
What is a nostr address?
+

Flotilla hosts spaces on the Nostr protocol import Link from "@lib/components/Link.svelte" import Button from "@lib/components/Button.svelte" + import ModalHeader from "@lib/components/ModalHeader.svelte"

-
-

What is Nostr?

-
+ +
What is nostr?
+

Nostr is way to build social apps that talk to eachother. Users own their social identity instead of renting it from a tech company, and can bring it with diff --git a/src/app/components/InfoRelay.svelte b/src/app/components/InfoRelay.svelte index 45381df3..2ad7682f 100644 --- a/src/app/components/InfoRelay.svelte +++ b/src/app/components/InfoRelay.svelte @@ -1,12 +1,13 @@

-
-

What is a relay?

-
+ +
What is a relay?
+

Flotilla hosts spaces on the Nostr protocol + import {goto} from '$app/navigation' + import Icon from '@lib/components/Icon.svelte' + import Link from '@lib/components/Link.svelte' + import Button from '@lib/components/Button.svelte' + import Divider from '@lib/components/Divider.svelte' + import CardButton from '@lib/components/CardButton.svelte' + import SpaceAvatar from "@app/components/SpaceAvatar.svelte" + import RelayName from "@app/components/RelayName.svelte" + import RelayDescription from "@app/components/RelayDescription.svelte" + import SpaceCreateExternal from "@app/components/SpaceCreateExternal.svelte" + import {userMembership, getMembershipUrls} from "@app/state" + import {makeSpacePath} from "@app/routes" + import {pushModal} from "@app/modal" + + const createSpace = () => pushModal(SpaceCreateExternal) + + const browseSpaces = () => goto("/discover") + + +

diff --git a/src/app/components/MenuSettings.svelte b/src/app/components/MenuSettings.svelte new file mode 100644 index 00000000..addd5384 --- /dev/null +++ b/src/app/components/MenuSettings.svelte @@ -0,0 +1,47 @@ + + + diff --git a/src/app/components/MenuSpaces.svelte b/src/app/components/MenuSpaces.svelte new file mode 100644 index 00000000..71829030 --- /dev/null +++ b/src/app/components/MenuSpaces.svelte @@ -0,0 +1,136 @@ + + + diff --git a/src/app/components/PrimaryNav.svelte b/src/app/components/PrimaryNav.svelte index d1313770..1550e2ed 100644 --- a/src/app/components/PrimaryNav.svelte +++ b/src/app/components/PrimaryNav.svelte @@ -6,11 +6,20 @@ import PrimaryNavItem from "@lib/components/PrimaryNavItem.svelte" import SpaceAdd from "@app/components/SpaceAdd.svelte" import SpaceAvatar from "@app/components/SpaceAvatar.svelte" + import MenuHome from "@app/components/MenuHome.svelte" + import MenuSpaces from "@app/components/MenuSpaces.svelte" + import MenuSettings from "@app/components/MenuSettings.svelte" import {userMembership, getMembershipUrls} from "@app/state" import {pushModal} from "@app/modal" import {makeSpacePath, getPrimaryNavItemIndex} from "@app/routes" const addSpace = () => pushModal(SpaceAdd) + + const showHomeMenu = () => pushModal(MenuHome) + + const showSpacesMenu = () => pushModal(MenuSpaces) + + const showSettingsMenu = () => pushModal(MenuSettings)
- Notes + Threads
diff --git a/src/routes/spaces/[nrelay]/[[room]]/+page.svelte b/src/routes/spaces/[nrelay]/[[room]]/+page.svelte index 444d5cc3..82a9ae5c 100644 --- a/src/routes/spaces/[nrelay]/[[room]]/+page.svelte +++ b/src/routes/spaces/[nrelay]/[[room]]/+page.svelte @@ -17,6 +17,7 @@ import Icon from "@lib/components/Icon.svelte" import Button from "@lib/components/Button.svelte" import Spinner from "@lib/components/Spinner.svelte" + import PageBar from "@lib/components/PageBar.svelte" import Divider from "@lib/components/Divider.svelte" import ChannelMessage from "@app/components/ChannelMessage.svelte" import ChannelCompose from "@app/components/ChannelCompose.svelte" @@ -81,13 +82,12 @@
-
-
-
- - {room} -
+ +
+ +
+ {room} +
{#if room !== GENERAL} {#if getMembershipRoomsByUrl(url, $userMembership).includes(room)}
-
+
{#each elements as { type, id, value, showPubkey } (id)} {#if type === "date"} @@ -123,7 +123,5 @@

-
- -
+
diff --git a/src/routes/spaces/[nrelay]/calendar/+page.svelte b/src/routes/spaces/[nrelay]/calendar/+page.svelte index 05c4177d..b1bb482c 100644 --- a/src/routes/spaces/[nrelay]/calendar/+page.svelte +++ b/src/routes/spaces/[nrelay]/calendar/+page.svelte @@ -6,6 +6,7 @@ import Icon from "@lib/components/Icon.svelte" import Button from "@lib/components/Button.svelte" import Spinner from "@lib/components/Spinner.svelte" + import PageBar from "@lib/components/PageBar.svelte" import Divider from "@lib/components/Divider.svelte" import EventItem from "@app/components/EventItem.svelte" import EventCreate from "@app/components/EventCreate.svelte" @@ -41,15 +42,12 @@
-
-
-
- - Calendar -
+ +
+
-
+ Calendar +
{#each items as { event, dateDisplay }, i (event.id)} {#if dateDisplay} @@ -68,7 +66,7 @@