generated from lucien/api-template
add: improved UI by adding CSS files
This commit is contained in:
parent
1656e95557
commit
42e6acd9ca
19 changed files with 543 additions and 197 deletions
|
@ -1,6 +1,8 @@
|
|||
import { Link } from "react-router-dom";
|
||||
import { Message, User, Channel } from "../types";
|
||||
|
||||
import "../styles/MessageComponent.css";
|
||||
|
||||
export default function MessageComponent({ message, user, channel, deleteMessage }: {
|
||||
message: Message;
|
||||
user: User | undefined;
|
||||
|
@ -9,7 +11,7 @@ export default function MessageComponent({ message, user, channel, deleteMessage
|
|||
}) {
|
||||
|
||||
return (
|
||||
<li key={message.id}>
|
||||
<div key={message.id} className="message">
|
||||
<Link to={`/u/${message.username}`}>{message.username}</Link>:{" "}
|
||||
{message.content.split(" ").map((word, index) => {
|
||||
if (word.startsWith("@")) {
|
||||
|
@ -28,6 +30,6 @@ export default function MessageComponent({ message, user, channel, deleteMessage
|
|||
<p>In <Link to={`/c/${message.channel_name}`}>{message.channel_name}</Link></p>
|
||||
)
|
||||
}
|
||||
</li>
|
||||
</div>
|
||||
);
|
||||
}
|
32
front/src/components/TopBar.tsx
Normal file
32
front/src/components/TopBar.tsx
Normal file
|
@ -0,0 +1,32 @@
|
|||
import { Link } from "react-router-dom"
|
||||
import { User } from "../types"
|
||||
|
||||
import "../styles/TopBar.css"
|
||||
|
||||
export default function TopBar({ user }: { user: User | undefined }) {
|
||||
return (
|
||||
<div className="topbar">
|
||||
<div className="topbar-left">
|
||||
<h1>Tanuki's Forum</h1>
|
||||
<Link to="/">Home</Link>
|
||||
<Link to="/channels">Channels</Link>
|
||||
</div>
|
||||
{user ? (
|
||||
<div className="topbar-right">
|
||||
<Link to={`/u/${user.username}`}>{user.username}</Link>
|
||||
<button onClick={() => {
|
||||
localStorage.removeItem("token")
|
||||
window.location.reload()
|
||||
}}>
|
||||
Logout
|
||||
</button>
|
||||
</div>
|
||||
) : (
|
||||
<div className="topbar-right">
|
||||
<Link to="/login">Login</Link>
|
||||
<Link to="/register">Register</Link>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
|
@ -1,3 +1,7 @@
|
|||
html {
|
||||
background-color: #FFE0E3;
|
||||
}
|
||||
|
||||
.cat {
|
||||
width: 100px;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
import { useParams, Link } from "react-router-dom";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { Channel, Messages, User } from "../types";
|
||||
import TopBar from "../components/TopBar";
|
||||
import MessageComponent from "../components/MessageComponent";
|
||||
import axios from "axios";
|
||||
|
||||
import "../styles/ChannelPage.css";
|
||||
|
||||
export default function ChannelPage() {
|
||||
const { name } = useParams();
|
||||
const [channel, setChannel] = useState<Channel>();
|
||||
|
@ -102,17 +105,24 @@ export default function ChannelPage() {
|
|||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Link to="/">Home</Link>
|
||||
<h1>Channel {channel.name}</h1>
|
||||
<p>{channel.description}</p>
|
||||
<p>Owner: <Link to={`/u/${channel.owner_username}`}>{channel.owner_username}</Link></p>
|
||||
{channel.name.toLowerCase().includes("cat") && (
|
||||
<img src="/cat.jpg" alt="cat" className="cat" />
|
||||
)}
|
||||
{
|
||||
token ? (
|
||||
<form onSubmit={handleSubmit}>
|
||||
<div className="channel-page">
|
||||
<TopBar user={user} />
|
||||
<div className="channel">
|
||||
<h2>Channel {channel.name}</h2>
|
||||
<p>{channel.description}</p>
|
||||
<p>Owner: <Link to={`/u/${channel.owner_username}`}>{channel.owner_username}</Link></p>
|
||||
{channel.name.toLowerCase().includes("cat") && (
|
||||
<img src="/cat.jpg" alt="cat" className="cat" />
|
||||
)}
|
||||
{token ? (
|
||||
<form onSubmit={handleSubmit} className="message-form">
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Message"
|
||||
value={message}
|
||||
onChange={(e) => setMessage(e.target.value)}
|
||||
/>
|
||||
<button type="submit">Send</button>
|
||||
{searchedUsers.length > 0 && (
|
||||
<div>
|
||||
<p>Mentions:</p>
|
||||
|
@ -134,37 +144,28 @@ export default function ChannelPage() {
|
|||
))}
|
||||
</div>
|
||||
)}
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Message"
|
||||
value={message}
|
||||
onChange={(e) => setMessage(e.target.value)}
|
||||
/>
|
||||
<button type="submit">Send</button>
|
||||
</form>
|
||||
) : (
|
||||
<div>
|
||||
<div className="login-prompt">
|
||||
<Link to="/login">Login</Link>
|
||||
<Link to="/register">Register</Link>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
<ul>
|
||||
{messages.slice(0, maxMessageToShown).map((message) => (
|
||||
<MessageComponent
|
||||
key={message.id}
|
||||
message={message}
|
||||
user={user}
|
||||
channel={channel}
|
||||
deleteMessage={deleteMessage}
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
{
|
||||
messages.length > maxMessageToShown && (
|
||||
<button onClick={() => setMaxMessageToShown(maxMessageToShown + 10)}>Show more</button>
|
||||
)
|
||||
}
|
||||
)}
|
||||
<div className="messages-list">
|
||||
{messages.slice(0, maxMessageToShown).map((message) => (
|
||||
<MessageComponent
|
||||
key={message.id}
|
||||
message={message}
|
||||
user={user}
|
||||
channel={channel}
|
||||
deleteMessage={deleteMessage}
|
||||
/>
|
||||
))}
|
||||
{messages.length > maxMessageToShown && (
|
||||
<button onClick={() => setMaxMessageToShown(maxMessageToShown + 10)}>Show more</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -1,13 +1,28 @@
|
|||
import { useState, useEffect } from "react"
|
||||
import { Link } from "react-router-dom"
|
||||
import { Channels } from "../types"
|
||||
import { Channels, User } from "../types"
|
||||
import axios from "axios"
|
||||
import TopBar from "../components/TopBar"
|
||||
|
||||
import "../styles/ChannelsPage.css"
|
||||
|
||||
export default function ChannelsPage() {
|
||||
const [channels, setChannels] = useState<Channels>();
|
||||
const [search, setSearch] = useState<string>("");
|
||||
const [user, setUser] = useState<User>();
|
||||
|
||||
useEffect(() => {
|
||||
const token = localStorage.getItem("token")
|
||||
|
||||
if (token) {
|
||||
axios
|
||||
.post("/api/auth/me", {
|
||||
token: token
|
||||
})
|
||||
.then((res) => {
|
||||
setUser(res.data)
|
||||
})
|
||||
}
|
||||
axios
|
||||
.get("/api/channels")
|
||||
.then((res) => {
|
||||
|
@ -31,22 +46,24 @@ export default function ChannelsPage() {
|
|||
}, [])
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Link to="/">Home</Link>
|
||||
<h1>Channels</h1>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Search channels"
|
||||
value={search}
|
||||
onChange={(e) => setSearch(e.target.value)}
|
||||
/>
|
||||
<ul>
|
||||
{channels?.filter((channel) => channel.name.toLowerCase().includes(search.toLowerCase())).map((channel) => (
|
||||
<li key={channel.id}>
|
||||
<Link to={`/c/${channel.name}`}>{channel.name}</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<div className="channels-page">
|
||||
<TopBar user={user} />
|
||||
<div className="channels-page-channels">
|
||||
<h2>Channels</h2>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Search channels"
|
||||
value={search}
|
||||
onChange={(e) => setSearch(e.target.value)}
|
||||
/>
|
||||
<ul>
|
||||
{channels?.filter((channel) => channel.name.toLowerCase().includes(search.toLowerCase())).map((channel) => (
|
||||
<li key={channel.id}>
|
||||
<Link to={`/c/${channel.name}`}>{channel.name}</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
|
@ -1,17 +1,29 @@
|
|||
import { useState, useEffect } from "react";
|
||||
import { Link, useNavigate } from "react-router-dom";
|
||||
import { User } from "../types";
|
||||
import axios from "axios";
|
||||
import TopBar from "../components/TopBar";
|
||||
|
||||
import "../styles/CreateChannel.css";
|
||||
|
||||
export default function CreateChannel() {
|
||||
const navigate = useNavigate();
|
||||
const [name, setName] = useState("");
|
||||
const [description, setDescription] = useState("");
|
||||
const [token, setToken] = useState<string>("");
|
||||
const [user , setUser] = useState<User>();
|
||||
|
||||
useEffect(() => {
|
||||
const localToken = localStorage.getItem("token");
|
||||
if (localToken) setToken(localToken);
|
||||
if (localToken) {
|
||||
setToken(localToken)
|
||||
|
||||
axios
|
||||
.post("/api/auth/me", { token: localToken })
|
||||
.then((res) => {
|
||||
setUser(res.data);
|
||||
});
|
||||
}
|
||||
}, []);
|
||||
|
||||
function handleSubmit(e: React.FormEvent) {
|
||||
|
@ -27,31 +39,33 @@ export default function CreateChannel() {
|
|||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Link to="/">Home</Link>
|
||||
<h1>Create Channel</h1>
|
||||
<form onSubmit={handleSubmit}>
|
||||
<p>
|
||||
{!/^[a-zA-Z0-9-_]+$/.test(name) && name.length != 0 && (
|
||||
<span>Channel name can only contain letters, numbers, - and _</span>
|
||||
)}
|
||||
</p>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Name"
|
||||
value={name}
|
||||
onChange={(e) => setName(e.target.value)}
|
||||
/>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Description"
|
||||
value={description}
|
||||
onChange={(e) => setDescription(e.target.value)}
|
||||
/>
|
||||
<button type="submit" disabled={!/^[a-zA-Z0-9-_]+$/.test(name)}>
|
||||
Create
|
||||
</button>
|
||||
</form>
|
||||
<div className="create-channel-page">
|
||||
<TopBar user={user}/>
|
||||
<div className="create-channel">
|
||||
<h1>Create Channel</h1>
|
||||
<form onSubmit={handleSubmit}>
|
||||
<p>
|
||||
{!/^[a-zA-Z0-9-_]+$/.test(name) && name.length != 0 && (
|
||||
<span>Channel name can only contain letters, numbers, - and _</span>
|
||||
)}
|
||||
</p>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Name"
|
||||
value={name}
|
||||
onChange={(e) => setName(e.target.value)}
|
||||
/>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Description"
|
||||
value={description}
|
||||
onChange={(e) => setDescription(e.target.value)}
|
||||
/>
|
||||
<button type="submit" disabled={!/^[a-zA-Z0-9-_]+$/.test(name)}>
|
||||
Create
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -1,9 +1,12 @@
|
|||
import { useState, useEffect } from "react"
|
||||
import { Link } from "react-router-dom"
|
||||
import { Channels, RecentChannels, User, Messages } from "../types"
|
||||
import TopBar from "../components/TopBar"
|
||||
import MessageComponent from "../components/MessageComponent"
|
||||
import axios from "axios"
|
||||
|
||||
import "../styles/Home.css"
|
||||
|
||||
export default function Home() {
|
||||
const [user, setUser] = useState<User>();
|
||||
const [channels, setChannels] = useState<RecentChannels>();
|
||||
|
@ -80,59 +83,66 @@ export default function Home() {
|
|||
}, [search])
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1>Home</h1>
|
||||
{user ? (
|
||||
<div>
|
||||
<p>Welcome {user.username}</p>
|
||||
<button onClick={() => {
|
||||
localStorage.removeItem("token")
|
||||
window.location.reload()
|
||||
}}>Logout</button>
|
||||
<Link to="/create-channel">Create Channel</Link>
|
||||
<div className="home">
|
||||
<TopBar user={user} />
|
||||
<div className="home-header">
|
||||
<div className="home-header-text">
|
||||
<h2>Welcome to Tanuki's forum !</h2>
|
||||
<p>
|
||||
I don't know what to say, but I hope you will enjoy your stay here.
|
||||
</p>
|
||||
</div>
|
||||
) : (
|
||||
<div>
|
||||
<Link to="/login">Login</Link>
|
||||
<Link to="/register">Register</Link>
|
||||
<img src="osaka_arch.png" alt="osaka" className="osaka"/>
|
||||
</div>
|
||||
<div className="main-content">
|
||||
<div className="home-messages">
|
||||
<h2>Last messages</h2>
|
||||
<div className="messages-list">
|
||||
{messages?.map((message) => (
|
||||
<MessageComponent
|
||||
key={message.id}
|
||||
message={message}
|
||||
user={user}
|
||||
channel={undefined}
|
||||
deleteMessage={undefined}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<h2>Recent active channels</h2>
|
||||
<ul>
|
||||
{channels?.map((channel) => (
|
||||
<li key={channel.id}>
|
||||
<Link to={`/c/${channel.name}`}>{channel.name}</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<h2>Search channels</h2>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Search channels"
|
||||
value={search}
|
||||
onChange={(e) => setSearch(e.target.value)}
|
||||
/>
|
||||
<ul>
|
||||
{searchedChannels?.map((channel) => (
|
||||
<li key={channel.id}>
|
||||
<Link to={`/c/${channel.name}`}>{channel.name}</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<Link to={'/channels'}>All channels</Link>
|
||||
<h2>Last messages</h2>
|
||||
<ul>
|
||||
{messages?.map((message) => (
|
||||
<MessageComponent
|
||||
key={message.id}
|
||||
message={message}
|
||||
user={user}
|
||||
channel={undefined}
|
||||
deleteMessage={undefined}
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
<img src="osaka_arch.png" alt="osaka" className="osaka"/>
|
||||
<div className="channels">
|
||||
<h2>Channels</h2>
|
||||
<Link to={'/channels'}>All channels</Link>
|
||||
{user && (
|
||||
<Link to={'/create-channel'}>Create channel</Link>
|
||||
)}
|
||||
<div className="channels-recent">
|
||||
<h3>Recent active channels</h3>
|
||||
<ul>
|
||||
{channels?.map((channel) => (
|
||||
<li key={channel.id}>
|
||||
<Link to={`/c/${channel.name}`}>{channel.name}</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
<div className="channels-search">
|
||||
<h3>Search channels</h3>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Search channels"
|
||||
value={search}
|
||||
onChange={(e) => setSearch(e.target.value)}
|
||||
/>
|
||||
<ul>
|
||||
{searchedChannels?.map((channel) => (
|
||||
<li key={channel.id}>
|
||||
<Link to={`/c/${channel.name}`}>{channel.name}</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
|
@ -1,6 +1,9 @@
|
|||
import axios from "axios";
|
||||
import { useState } from "react";
|
||||
import { useNavigate, Link } from "react-router-dom";
|
||||
import TopBar from "../components/TopBar";
|
||||
|
||||
import "../styles/Login.css";
|
||||
|
||||
export default function Login() {
|
||||
const [username, setUsername] = useState("");
|
||||
|
@ -21,25 +24,27 @@ export default function Login() {
|
|||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Link to="/">Home</Link>
|
||||
<h1>Login</h1>
|
||||
<form onSubmit={handleSubmit}>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Username"
|
||||
value={username}
|
||||
onChange={(e) => setUsername(e.target.value)}
|
||||
/>
|
||||
<input
|
||||
type="password"
|
||||
placeholder="Password"
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
/>
|
||||
<button type="submit">Login</button>
|
||||
</form>
|
||||
<Link to="/register">Register</Link>
|
||||
<div className="login-page">
|
||||
<TopBar user={undefined}/>
|
||||
<div className="login">
|
||||
<h2>Login</h2>
|
||||
<form onSubmit={handleSubmit}>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Username"
|
||||
value={username}
|
||||
onChange={(e) => setUsername(e.target.value)}
|
||||
/>
|
||||
<input
|
||||
type="password"
|
||||
placeholder="Password"
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
/>
|
||||
<button type="submit">Login</button>
|
||||
</form>
|
||||
<Link to="/register">Register</Link>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -1,6 +1,9 @@
|
|||
import axios from "axios";
|
||||
import { useState } from "react";
|
||||
import { useNavigate, Link } from "react-router-dom";
|
||||
import TopBar from "../components/TopBar";
|
||||
|
||||
import "../styles/Register.css";
|
||||
|
||||
export default function Register () {
|
||||
const [username, setUsername] = useState("");
|
||||
|
@ -28,32 +31,34 @@ export default function Register () {
|
|||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Link to="/">Home</Link>
|
||||
<h1>Register</h1>
|
||||
<form onSubmit={handleSubmit}>
|
||||
<p>
|
||||
{!/^[a-zA-Z0-9-_]+$/.test(username) && username.length != 0 && (
|
||||
<span>Username can only contain letters, numbers, - and _</span>
|
||||
)}
|
||||
</p>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Username"
|
||||
value={username}
|
||||
onChange={(e) => setUsername(e.target.value)}
|
||||
/>
|
||||
<input
|
||||
type="password"
|
||||
placeholder="Password"
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
/>
|
||||
<button type="submit" disabled={!/^[a-zA-Z0-9-_]+$/.test(username)}>
|
||||
Register
|
||||
</button>
|
||||
</form>
|
||||
<Link to="/login">Login</Link>
|
||||
<div className="register-page">
|
||||
<TopBar user={undefined}/>
|
||||
<div className="register">
|
||||
<h2>Register</h2>
|
||||
<form onSubmit={handleSubmit}>
|
||||
<p>
|
||||
{!/^[a-zA-Z0-9-_]+$/.test(username) && username.length != 0 && (
|
||||
<span>Username can only contain letters, numbers, - and _</span>
|
||||
)}
|
||||
</p>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Username"
|
||||
value={username}
|
||||
onChange={(e) => setUsername(e.target.value)}
|
||||
/>
|
||||
<input
|
||||
type="password"
|
||||
placeholder="Password"
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
/>
|
||||
<button type="submit" disabled={!/^[a-zA-Z0-9-_]+$/.test(username)}>
|
||||
Register
|
||||
</button>
|
||||
</form>
|
||||
<Link to="/login">Login</Link>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -1,17 +1,32 @@
|
|||
import { useParams, Link } from "react-router-dom";
|
||||
import { useEffect, useState } from "react";
|
||||
import { User, Messages } from "../types";
|
||||
import TopBar from "../components/TopBar";
|
||||
import MessageComponent from "../components/MessageComponent";
|
||||
import axios from "axios";
|
||||
|
||||
import "../styles/UserPage.css";
|
||||
|
||||
export default function UserPage() {
|
||||
const { username } = useParams();
|
||||
const [user, setUser] = useState<User>();
|
||||
const [pageUser, setPageUser] = useState<User>();
|
||||
const [messages, setMessages] = useState<Messages>();
|
||||
const [user, setUser] = useState<User>();
|
||||
|
||||
useEffect(() => {
|
||||
const localToken = localStorage.getItem("token");
|
||||
|
||||
if (localToken) {
|
||||
axios
|
||||
.post("/api/auth/me", { token: localToken }).then((res) => {
|
||||
setUser(res.data);
|
||||
});
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
axios.get(`/api/users/${username}`).then((res) => {
|
||||
setUser(res.data);
|
||||
setPageUser(res.data);
|
||||
});
|
||||
|
||||
axios.get(`/api/users/${username}/lastmessages`).then((res) => {
|
||||
|
@ -30,27 +45,31 @@ export default function UserPage() {
|
|||
return () => { clearInterval(id) }
|
||||
}, [username])
|
||||
|
||||
if (!user) {
|
||||
if (!pageUser) {
|
||||
return <div>Loading...</div>;
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Link to="/">Home</Link>
|
||||
<h1>{user.username}</h1>
|
||||
{user.admin ? <p>Admin</p> : <p>User</p>}
|
||||
<h1>Last messages</h1>
|
||||
<ul>
|
||||
{messages?.map((message) => (
|
||||
<MessageComponent
|
||||
key={message.id}
|
||||
message={message}
|
||||
user={user}
|
||||
channel={undefined}
|
||||
deleteMessage={undefined}
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
<div className="user-page">
|
||||
<TopBar user={user} />
|
||||
<div className="user">
|
||||
<h2>{pageUser.username}</h2>
|
||||
{pageUser.admin ? <p>Admin</p> : <p>User</p>}
|
||||
<div className="user-messages">
|
||||
<h2>Last messages</h2>
|
||||
<div className="messages-list">
|
||||
{messages?.map((message) => (
|
||||
<MessageComponent
|
||||
key={message.id}
|
||||
message={message}
|
||||
user={pageUser}
|
||||
channel={undefined}
|
||||
deleteMessage={undefined}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
35
front/src/styles/ChannelPage.css
Normal file
35
front/src/styles/ChannelPage.css
Normal file
|
@ -0,0 +1,35 @@
|
|||
.channel-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.channel {
|
||||
width: 97%;
|
||||
border: 1px solid #270722;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.message-form {
|
||||
margin: 16px 0;
|
||||
}
|
||||
|
||||
.login-prompt {
|
||||
margin: 16px 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.messages-list {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
15
front/src/styles/ChannelsPage.css
Normal file
15
front/src/styles/ChannelsPage.css
Normal file
|
@ -0,0 +1,15 @@
|
|||
.channels-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.channels-page-channels {
|
||||
width: 97%;
|
||||
border: 1px solid #270722;
|
||||
padding: 10px;
|
||||
}
|
14
front/src/styles/CreateChannel.css
Normal file
14
front/src/styles/CreateChannel.css
Normal file
|
@ -0,0 +1,14 @@
|
|||
.create-channel-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: start;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.create-channel {
|
||||
width: 97%;
|
||||
border: 1px solid #270722;
|
||||
padding: 10px;
|
||||
}
|
71
front/src/styles/Home.css
Normal file
71
front/src/styles/Home.css
Normal file
|
@ -0,0 +1,71 @@
|
|||
.home {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.main-content {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: top;
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
.home-header {
|
||||
width: 97%;
|
||||
border: 1px solid #270722;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: top;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.home-messages {
|
||||
width: 60%;
|
||||
border: 1px solid #270722;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.messages-list {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.channels {
|
||||
width: 34%;
|
||||
border: 1px solid #270722;
|
||||
min-height: 100%;
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
@media (max-width: 800px) {
|
||||
.home-header {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.main-content {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.home-messages {
|
||||
width: 97%;
|
||||
}
|
||||
|
||||
.channels {
|
||||
width: 97%;
|
||||
}
|
||||
}
|
14
front/src/styles/Login.css
Normal file
14
front/src/styles/Login.css
Normal file
|
@ -0,0 +1,14 @@
|
|||
.login-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: start;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.login {
|
||||
width: 97%;
|
||||
border: 1px solid #270722;
|
||||
padding: 10px;
|
||||
}
|
5
front/src/styles/MessageComponent.css
Normal file
5
front/src/styles/MessageComponent.css
Normal file
|
@ -0,0 +1,5 @@
|
|||
.message {
|
||||
width: 95%;
|
||||
border: 1px solid #270722;
|
||||
padding: 10px;
|
||||
}
|
14
front/src/styles/Register.css
Normal file
14
front/src/styles/Register.css
Normal file
|
@ -0,0 +1,14 @@
|
|||
.register-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: start;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.register {
|
||||
width: 97%;
|
||||
border: 1px solid #270722;
|
||||
padding: 10px;
|
||||
}
|
39
front/src/styles/TopBar.css
Normal file
39
front/src/styles/TopBar.css
Normal file
|
@ -0,0 +1,39 @@
|
|||
.topbar {
|
||||
width: 97%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border: 1px solid #270722;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.topbar-left {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.topbar-right {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
@media (max-width: 560px) {
|
||||
.topbar {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.topbar-left {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.topbar-right {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
30
front/src/styles/UserPage.css
Normal file
30
front/src/styles/UserPage.css
Normal file
|
@ -0,0 +1,30 @@
|
|||
.user-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.user {
|
||||
width: 97%;
|
||||
border: 1px solid #270722;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.user-messages {
|
||||
width: 97%;
|
||||
border: 1px solid #270722;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.messages-list {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue