mirror of
https://github.com/balzack/databag.git
synced 2025-05-04 15:35:16 +00:00
preparing add topic
This commit is contained in:
parent
74087e3b7c
commit
cdaf4e03d1
@ -2,6 +2,7 @@ import { ConversationWrapper } from './Conversation.styled';
|
|||||||
import { SettingOutlined, RightOutlined, CloseOutlined } from '@ant-design/icons';
|
import { SettingOutlined, RightOutlined, CloseOutlined } from '@ant-design/icons';
|
||||||
import { useConversation } from './useConversation.hook';
|
import { useConversation } from './useConversation.hook';
|
||||||
import { Logo } from 'logo/Logo';
|
import { Logo } from 'logo/Logo';
|
||||||
|
import { AddTopic } from './addTopic/AddTopic';
|
||||||
|
|
||||||
export function Conversation({ closeConversation, openDetails, cardId, channelId }) {
|
export function Conversation({ closeConversation, openDetails, cardId, channelId }) {
|
||||||
|
|
||||||
@ -29,6 +30,14 @@ console.log(state);
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="thread">
|
||||||
|
</div>
|
||||||
|
<div class="divider">
|
||||||
|
<div class="line" />
|
||||||
|
</div>
|
||||||
|
<div class="topic">
|
||||||
|
<AddTopic />
|
||||||
|
</div>
|
||||||
</ConversationWrapper>
|
</ConversationWrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -49,4 +49,21 @@ export const ConversationWrapper = styled.div`
|
|||||||
padding-left: 16px;
|
padding-left: 16px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.thread {
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.divider {
|
||||||
|
padding-left: 16px;
|
||||||
|
padding-right: 16px;
|
||||||
|
|
||||||
|
.line {
|
||||||
|
border-top: 1px solid ${Colors.divider};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.topic {
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
`
|
`
|
||||||
|
37
net/web/src/session/conversation/addTopic/AddTopic.jsx
Normal file
37
net/web/src/session/conversation/addTopic/AddTopic.jsx
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
import { AddTopicWrapper } from './AddTopic.styled';
|
||||||
|
import { useAddTopic } from './useAddTopic.hook';
|
||||||
|
import { Input } from 'antd';
|
||||||
|
import { useRef, useState } from 'react';
|
||||||
|
import { FontColorsOutlined, FontSizeOutlined, PaperClipOutlined, SendOutlined } from '@ant-design/icons';
|
||||||
|
|
||||||
|
export function AddTopic() {
|
||||||
|
|
||||||
|
const [hint, setHint] = useState("send");
|
||||||
|
const msg = useRef();
|
||||||
|
|
||||||
|
const keyDown = (e) => {
|
||||||
|
if (e.key === 'Enter' && !e.shiftKey) {
|
||||||
|
msg.current.blur();
|
||||||
|
console.log("SEND");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AddTopicWrapper>
|
||||||
|
<div class="carousel"></div>
|
||||||
|
<div class="message">
|
||||||
|
<Input.TextArea ref={msg} placeholder="New Message" spellCheck="true" autoSize={{ minRows: 2, maxRows: 6 }}
|
||||||
|
autocapitalize="none" enterkeyhint="send" onKeyDown={(e) => keyDown(e)} />
|
||||||
|
</div>
|
||||||
|
<div class="buttons">
|
||||||
|
<div class="button space"><PaperClipOutlined /></div>
|
||||||
|
<div class="button space"><FontSizeOutlined /></div>
|
||||||
|
<div class="button space"><FontColorsOutlined /></div>
|
||||||
|
<div class="end">
|
||||||
|
<div class="button"><SendOutlined /></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</AddTopicWrapper>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
51
net/web/src/session/conversation/addTopic/AddTopic.styled.js
Normal file
51
net/web/src/session/conversation/addTopic/AddTopic.styled.js
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
import styled from 'styled-components';
|
||||||
|
import Colors from 'constants/Colors';
|
||||||
|
|
||||||
|
export const AddTopicWrapper = styled.div`
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
.message {
|
||||||
|
width: 100%;
|
||||||
|
padding-left: 16px;
|
||||||
|
padding-right: 16px;
|
||||||
|
padding-top: 8px;
|
||||||
|
padding-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttons {
|
||||||
|
padding-left: 16px;
|
||||||
|
padding-right: 16px;
|
||||||
|
padding-bottom: 16px;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.button {
|
||||||
|
display: flex;
|
||||||
|
flex-align: center;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
cursor: pointer;
|
||||||
|
border: 1px solid ${Colors.divider};
|
||||||
|
background-color: ${Colors.white};
|
||||||
|
font-size: 18px;
|
||||||
|
color: ${Colors.enabled};
|
||||||
|
}
|
||||||
|
|
||||||
|
.space {
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.end {
|
||||||
|
flex-grow: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`
|
@ -0,0 +1,16 @@
|
|||||||
|
import { useContext, useState } from 'react';
|
||||||
|
|
||||||
|
export function useAddTopic() {
|
||||||
|
|
||||||
|
const [state, setState] = useState({});
|
||||||
|
|
||||||
|
const updateState = (value) => {
|
||||||
|
setState((s) => ({ ...s, ...value }));
|
||||||
|
};
|
||||||
|
|
||||||
|
const actions = {
|
||||||
|
};
|
||||||
|
|
||||||
|
return { state, actions };
|
||||||
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user