generated from lucien/api-template
add: added a pig
This commit is contained in:
parent
39193af2d6
commit
477fff18fd
4 changed files with 10 additions and 1 deletions
BIN
front/public/pig.png
Normal file
BIN
front/public/pig.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 180 KiB |
|
@ -23,6 +23,11 @@ export default function MessageComponent({ message, user, channel, deleteMessage
|
|||
return <span key={index}>{word} </span>;
|
||||
})}
|
||||
<p>{new Date(message.date * 1000).toLocaleString()}</p>
|
||||
<div>
|
||||
{message.content.toLocaleLowerCase().includes("gros cochon") && (
|
||||
<img src="/pig.png" alt="Gros cochon" className="pig" />
|
||||
)}
|
||||
</div>
|
||||
{channel && deleteMessage ? (
|
||||
user?.id === message.user_id || user?.id === channel?.owner_id || user?.admin === 1) && (
|
||||
<button onClick={() => {deleteMessage(message.id)}}>Delete</button>
|
||||
|
|
|
@ -8,4 +8,8 @@ html {
|
|||
|
||||
.osaka {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.pig {
|
||||
width: 100px;
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
.channel-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
justify-content: start;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue