From e3f51f638ff021334a45e4f1c6ad155bf727b56c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?My=20Go=EF=BC=81?= <118411001+Clear1oveE@users.noreply.github.com> Date: Wed, 13 Mar 2024 13:44:40 +0800 Subject: [PATCH] feat: update the format and changeChannel (#63) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add notices to a new collection the new collection named todolist, and there are small changes about how the pages look like. * feat: add notices to a new collection * style: update npm and run format * style: run npm format again * style: channel and notice style * feat: useremail is added automatically * ci: format-check * css: pass the lint * style: recover the background color * feat : update the saveChange * feat: update the title of login and doorpage * feat: update the format of saveChanges * feat: update the checknotice * feat: uodate checknotice format --------- Co-authored-by: 独 后藤 <1823773980@qq.com> Co-authored-by: sheeplin <1270610465@qq.com> Co-authored-by: 後藤ひとり <118675237+babuzeer@users.noreply.github.com> --- src/router.js | 2 + src/routes/EditChannelModal.svelte | 36 +++++++ src/routes/Modal.svelte | 2 + src/routes/checknotice.svelte | 43 +------- src/routes/login.svelte | 6 ++ src/routes/mainpage.svelte | 11 +- src/routes/updateChannel.svelte | 155 +++++++++++++++++++++++++++++ src/store.js | 1 + src/styles/doorpage.css | 1 + 9 files changed, 212 insertions(+), 45 deletions(-) create mode 100644 src/routes/updateChannel.svelte diff --git a/src/router.js b/src/router.js index e9a1c1b..83bafd1 100644 --- a/src/router.js +++ b/src/router.js @@ -11,6 +11,7 @@ import SelectTags from "./routes/selectTags.svelte"; import Mynotice from "./routes/mynotice.svelte"; import Chantemplate from "./routes/chantemplate.svelte"; import Checknotice from "./routes/checknotice.svelte"; +import UpdateChannel from "./routes/updateChannel.svelte"; export default { "/": DoorPage, "/login": Login, @@ -25,4 +26,5 @@ export default { "/mynotice": Mynotice, "/chantemplate": Chantemplate, "/checknotice": Checknotice, + "/updateChannel": UpdateChannel, }; diff --git a/src/routes/EditChannelModal.svelte b/src/routes/EditChannelModal.svelte index 8af97ba..5b6022a 100644 --- a/src/routes/EditChannelModal.svelte +++ b/src/routes/EditChannelModal.svelte @@ -61,3 +61,39 @@ + + diff --git a/src/routes/Modal.svelte b/src/routes/Modal.svelte index c4b3fb5..a2d25f0 100644 --- a/src/routes/Modal.svelte +++ b/src/routes/Modal.svelte @@ -44,5 +44,7 @@ padding: 30px; border-radius: 8px; position: relative; + /* width: 100%; + height: 100%; */ } diff --git a/src/routes/checknotice.svelte b/src/routes/checknotice.svelte index 336c05c..5876674 100644 --- a/src/routes/checknotice.svelte +++ b/src/routes/checknotice.svelte @@ -45,7 +45,6 @@ }); - {#each records as record}
{record.tittle}
@@ -54,49 +53,16 @@
{record.body}
- - +{/each} diff --git a/src/routes/login.svelte b/src/routes/login.svelte index 0442515..63bbbd5 100644 --- a/src/routes/login.svelte +++ b/src/routes/login.svelte @@ -51,3 +51,9 @@ {/if} + + diff --git a/src/routes/mainpage.svelte b/src/routes/mainpage.svelte index e775708..32144fd 100644 --- a/src/routes/mainpage.svelte +++ b/src/routes/mainpage.svelte @@ -9,6 +9,7 @@ currentUserEmail, currentchannelid, currentnoticeid, + currentchannelName, } from "../store.js"; const pb = new PocketBase(PocketBase_URL); @@ -23,10 +24,12 @@ let selectedChannel = null; function editChannel(channelName) { - const channel = createdChannels.find((c) => c.channelName === channelName); - if (channel) { - selectedChannel = channel; - } + currentchannelName.set(channelName); + push("/updateChannel"); + // const channel = createdChannels.find((c) => c.channelName === channelName); + // if (channel) { + // selectedChannel = channel; + // } } function handleUpdate() { diff --git a/src/routes/updateChannel.svelte b/src/routes/updateChannel.svelte new file mode 100644 index 0000000..95dc46c --- /dev/null +++ b/src/routes/updateChannel.svelte @@ -0,0 +1,155 @@ + + +

Update Your Channel

+ + +
+
+ +
+
+ +
+ {#if isLoading} +

Loading...

+ {:else} + + {/if} +
+ + diff --git a/src/store.js b/src/store.js index e085554..50b937e 100644 --- a/src/store.js +++ b/src/store.js @@ -6,3 +6,4 @@ export const currentchannelid = writable(""); //共享当前的频道id export const currentnoticeid = writable(""); //共享当前的通知id +export const currentchannelName = writable(""); diff --git a/src/styles/doorpage.css b/src/styles/doorpage.css index 03ac394..b2f1ef5 100644 --- a/src/styles/doorpage.css +++ b/src/styles/doorpage.css @@ -47,6 +47,7 @@ h1 { text-align: left; /* 居中对齐 */ margin-bottom: 50px; /* 下方空间 */ margin-top: 300px; + font-size: 4vw; /* 字体大小为视口宽度的2% */ } .highlighted {