diff --git a/.vim/coc-settings.json b/.vim/coc-settings.json new file mode 100644 index 000000000..b9db0bb53 --- /dev/null +++ b/.vim/coc-settings.json @@ -0,0 +1,3 @@ +{ + "eslint.experimental.useFlatConfig": false +} diff --git a/src/config/communityRooms.ts b/src/config/communityRooms.ts new file mode 100644 index 000000000..136768472 --- /dev/null +++ b/src/config/communityRooms.ts @@ -0,0 +1,10 @@ +export const communityRoomNames = [ + 'buy-and-sell', + 'crypto', + 'hacking', + 'leaks', + 'news', + 'organize', + 'politics', + 'resist', +] diff --git a/src/pages/About/About.tsx b/src/pages/About/About.tsx index 5331fc4a1..aca37fbfd 100644 --- a/src/pages/About/About.tsx +++ b/src/pages/About/About.tsx @@ -57,10 +57,6 @@ When you connect with a peer, Chitchatter automatically attempts to use [public- All public and private keys are generated locally. Your private key is never sent to any peer or server. -##### Community rooms - -There is [a public list of community rooms](https://github.com/jeremyckahn/chitchatter/wiki/Chitchatter-Community-Rooms) that you can join to discuss various topics. - ##### Conversation backfilling Conversation transcripts are erased from local memory as soon as you close the page or navigate away from the room. Conversations are only ever held in volatile memory and never persisted to any disk by Chitchatter. diff --git a/src/pages/Home/CommunityRoomSelector.tsx b/src/pages/Home/CommunityRoomSelector.tsx new file mode 100644 index 000000000..7de361f21 --- /dev/null +++ b/src/pages/Home/CommunityRoomSelector.tsx @@ -0,0 +1,67 @@ +import { useState, SyntheticEvent } from 'react' +import { useNavigate } from 'react-router-dom' +import Button from '@mui/material/Button' +import Box from '@mui/material/Box' +import Typography from '@mui/material/Typography' +import TextField from '@mui/material/TextField' +import Autocomplete from '@mui/material/Autocomplete' +import Accordion from '@mui/material/Accordion' +import AccordionSummary from '@mui/material/AccordionSummary' +import AccordionDetails from '@mui/material/AccordionDetails' +import ExpandMoreIcon from '@mui/icons-material/ExpandMore' + +import { communityRoomNames } from 'config/communityRooms' + +export const CommunityRoomSelector = () => { + const navigate = useNavigate() + const [selectedRoom, setSelectedRoom] = useState(null) + + const handleRoomNameChange = ( + _event: SyntheticEvent, + roomName: string | null + ) => { + setSelectedRoom(roomName) + } + + const handleJoinClick = () => { + navigate(`/public/${selectedRoom}`) + } + + return ( + + } + aria-controls="panel1-content" + id="panel1-header" + sx={{ + fontWeight: 'bold', + }} + > + Community rooms + + + + You can also chat in a public community room. You'll be anonymous, but + be careful what information you choose to share. + + + } + onChange={handleRoomNameChange} + sx={{ flexGrow: 1 }} + /> + + + + + ) +} diff --git a/src/pages/Home/Home.tsx b/src/pages/Home/Home.tsx index 33737256e..2015440bf 100644 --- a/src/pages/Home/Home.tsx +++ b/src/pages/Home/Home.tsx @@ -22,6 +22,7 @@ import { Form, Main } from 'components/Elements' import Logo from 'img/logo.svg?react' import { EmbedCodeDialog } from './EmbedCodeDialog' +import { CommunityRoomSelector } from './CommunityRoomSelector' const StyledLogo = styled(Logo)({}) @@ -100,7 +101,7 @@ export function Home({ userId }: HomeProps) { + + + +