-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
91 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import GenericQuark from "../../../nav/GenericQuark.jsx"; | ||
import {Link} from "react-router-dom"; | ||
|
||
export default function Quark({quark}) { | ||
return <Link to={`/lq_${quark._id}`}><GenericQuark icon={quark.iconUri} name={quark.name} /></Link> | ||
export default function Quark({quark, demo}) { | ||
return <Link to={demo ? `/demo/${quark._id}` : `/lq_${quark._id}`}><GenericQuark icon={quark.iconUri} name={quark.name} /></Link> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,5 @@ | ||
import Quark from "./Quark.jsx"; | ||
import {useContext, useEffect, useState} from "react"; | ||
import {AppContext} from "../../../../contexts/AppContext.js"; | ||
import {useQuery} from "@tanstack/react-query"; | ||
import GenericQuark from "../../../nav/GenericQuark.jsx"; | ||
import {useTranslation} from "react-i18next"; | ||
|
||
export default function QuarkList() { | ||
const { status, data, error, isLoading } = useQuery({queryKey: ['quark']}); | ||
const {t} = useTranslation(); | ||
|
||
if(isLoading) return <GenericQuark name={t("LOADING_QUARKS")}/>; | ||
return data.quarks.map((quark) => <Quark quark={quark} key={quark._id}/>) | ||
export default function QuarkList({list, demo}) { | ||
return list.map((quark) => <Quark demo={demo} quark={quark} key={quark._id}/>) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,63 @@ | ||
import mainViewStyles from "./MainView.module.css"; | ||
import quarkViewStyles from "./QuarkView.module.css"; | ||
import GenericQuark from "../components/nav/GenericQuark.jsx"; | ||
import QuarkHeader from "../components/_services/lightquark/nav/QuarkHeader.jsx"; | ||
import LightquarkChannelList from "../components/_services/lightquark/nav/LightquarkChannelList.jsx"; | ||
import Aviebox from "../components/_services/lightquark/nav/Aviebox.jsx"; | ||
import channelViewStyles from "./ChannelView.module.css"; | ||
import MessageInput from "../components/nav/MessageInput.jsx"; | ||
import clientStyles from "./ClientWrapper.module.css"; | ||
import {useMatch, useNavigate, useParams} from "react-router-dom"; | ||
import {useEffect} from "react"; | ||
import QuarkList from "../components/_services/lightquark/nav/QuarkList.jsx"; | ||
import Message from "../components/dialogs/Message.jsx"; | ||
|
||
const fakeQuarks = [{ | ||
_id: "9phq", | ||
iconUri: "https://pbs.twimg.com/profile_images/1773097531074891776/KjHzRCV4_400x400.png", | ||
name: "ninePLUS HQ", | ||
channels: [{ | ||
_id: "9phq_lobby", | ||
name: "lobby" | ||
}] | ||
}] | ||
|
||
const fakeMessages = { | ||
"9phq_lobby": [{ | ||
"username": "Hakase", | ||
"content": "Meow! :)" | ||
}] | ||
} | ||
|
||
export default function DemoView() { | ||
return <> | ||
const navigate = useNavigate(); | ||
const { quarkId, channelId } = useParams(); | ||
|
||
useEffect(() => { | ||
if(!quarkId) navigate("/demo/9phq/9phq_lobby") | ||
}, []); | ||
|
||
const currentFakeQuark = fakeQuarks.find(quark => quark._id === quarkId); | ||
if(!currentFakeQuark) return null; | ||
|
||
return <div className={clientStyles.client}> | ||
<div className={mainViewStyles.quarkList}> | ||
<GenericQuark/> | ||
<QuarkList demo={true} list={fakeQuarks}/> | ||
</div> | ||
<div className={quarkViewStyles.quarkView}> | ||
<div className={quarkViewStyles.channelListWrap}> | ||
<QuarkHeader interaction={false} quark={{ | ||
name: "World's realest quark :)" | ||
}}/> | ||
<LightquarkChannelList quark={{ | ||
_id: "1", | ||
channels: [{ | ||
_id: "2", | ||
name: "Rub my tummy!" | ||
}] | ||
}}/> | ||
<QuarkHeader interaction={false} quark={currentFakeQuark}/> | ||
<LightquarkChannelList demo={true} quark={currentFakeQuark}/> | ||
<Aviebox interaction={false} user={{ | ||
avatarUri: "https://google.com", | ||
username: "You!" | ||
}}/> | ||
</div> | ||
<div className={channelViewStyles.messageArea}> | ||
<div className={channelViewStyles.messages}> | ||
{fakeMessages[channelId]?.map((message, index) => <Message key={index} {...message}/>)} | ||
</div> | ||
<MessageInput interaction={false}/> | ||
</div> | ||
</div> | ||
</> | ||
</div> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1207503
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
quarky – ./
quarky.vercel.app
quarky-git-senpai-nineplus.vercel.app
quarky-nineplus.vercel.app
chatanimeattheoffice.vercel.app
quarky.nineplus.sh
quarky.hakase.life