chores: updates
This commit is contained in:
@@ -18,6 +18,7 @@ const StyledWrapper = styled.div`
|
|||||||
top: 0;
|
top: 0;
|
||||||
z-index: 99;
|
z-index: 99;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
border-top-left-radius: var(--br);
|
||||||
box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.1);
|
box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.1);
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
width: calc(100% - 1px);
|
width: calc(100% - 1px);
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ export default function EmojiPicker({ onSelect, ...rest }) {
|
|||||||
<StyledWrapper>
|
<StyledWrapper>
|
||||||
{visible ? (
|
{visible ? (
|
||||||
<Picker
|
<Picker
|
||||||
|
emojiSize={28}
|
||||||
|
emojiTooltip={true}
|
||||||
// set="twitter"
|
// set="twitter"
|
||||||
// data={data}
|
// data={data}
|
||||||
// set="twitter"
|
// set="twitter"
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export default function FileMessage({
|
|||||||
properties = { local_id: 0, name: "", size: 0, content_type: "" },
|
properties = { local_id: 0, name: "", size: 0, content_type: "" },
|
||||||
}) {
|
}) {
|
||||||
const [imageSize, setImageSize] = useState(null);
|
const [imageSize, setImageSize] = useState(null);
|
||||||
const [uploadinFile, setUploadinFile] = useState(false);
|
const [uploadingFile, setUploadingFile] = useState(false);
|
||||||
const removeLocalMessage = useRemoveLocalMessage({ context, id: to });
|
const removeLocalMessage = useRemoveLocalMessage({ context, id: to });
|
||||||
const {
|
const {
|
||||||
sendMessage,
|
sendMessage,
|
||||||
@@ -46,7 +46,7 @@ export default function FileMessage({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleUpSend = async ({ url, name, type }) => {
|
const handleUpSend = async ({ url, name, type }) => {
|
||||||
try {
|
try {
|
||||||
setUploadinFile(true);
|
setUploadingFile(true);
|
||||||
if (type.startsWith("image")) {
|
if (type.startsWith("image")) {
|
||||||
const size = await getImageSize(url);
|
const size = await getImageSize(url);
|
||||||
setImageSize(size);
|
setImageSize(size);
|
||||||
@@ -56,9 +56,9 @@ export default function FileMessage({
|
|||||||
.then((blobFile) => new File([blobFile], name, { type }));
|
.then((blobFile) => new File([blobFile], name, { type }));
|
||||||
|
|
||||||
await uploadFile(file);
|
await uploadFile(file);
|
||||||
setUploadinFile(false);
|
setUploadingFile(false);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setUploadinFile(false);
|
setUploadingFile(false);
|
||||||
console.log("fetch local file error", error);
|
console.log("fetch local file error", error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -97,9 +97,13 @@ export default function FileMessage({
|
|||||||
if (!content || !fromUser || !name) return null;
|
if (!content || !fromUser || !name) return null;
|
||||||
|
|
||||||
console.log("file content", content, name, content_type, size);
|
console.log("file content", content, name, content_type, size);
|
||||||
|
const sending = uploadingFile || isSending;
|
||||||
|
|
||||||
if (isImage(content_type, size))
|
if (isImage(content_type, size))
|
||||||
return (
|
return (
|
||||||
<Image
|
<Image
|
||||||
|
uploading={sending}
|
||||||
|
progress={progress}
|
||||||
properties={{ ...imageSize, ...properties }}
|
properties={{ ...imageSize, ...properties }}
|
||||||
size={size}
|
size={size}
|
||||||
content={content}
|
content={content}
|
||||||
@@ -107,7 +111,6 @@ export default function FileMessage({
|
|||||||
thumbnail={thumbnail}
|
thumbnail={thumbnail}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
const sending = uploadinFile || isSending;
|
|
||||||
return (
|
return (
|
||||||
<Styled className={`file_message ${sending ? "sending" : ""}`}>
|
<Styled className={`file_message ${sending ? "sending" : ""}`}>
|
||||||
<div className="basic">
|
<div className="basic">
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
// import { useOutsideClick } from "rooks";
|
|
||||||
import Tippy from "@tippyjs/react";
|
import Tippy from "@tippyjs/react";
|
||||||
import { hideAll } from "tippy.js";
|
import { hideAll } from "tippy.js";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const MarkdownOverrides = createGlobalStyle`
|
|||||||
margin: 0 ;
|
margin: 0 ;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
p {
|
p,.toastui-editor.md-mode {
|
||||||
margin:0 ;
|
margin:0 ;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
const StyledMenu = styled.ul`
|
const StyledMenu = styled.ul`
|
||||||
z-index: 999;
|
/* z-index: 999; */
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ const NavItem = ({ id, setFiles, toggleRemoveConfirm }) => {
|
|||||||
<Tippy
|
<Tippy
|
||||||
interactive
|
interactive
|
||||||
placement="right-start"
|
placement="right-start"
|
||||||
|
popperOptions={{ strategy: "fixed" }}
|
||||||
offset={[offset.y, offset.x]}
|
offset={[offset.y, offset.x]}
|
||||||
visible={contextMenuVisible}
|
visible={contextMenuVisible}
|
||||||
onClickOutside={hideContextMenu}
|
onClickOutside={hideContextMenu}
|
||||||
|
|||||||
@@ -11,13 +11,7 @@ import FileBox from "../../common/component/FileBox";
|
|||||||
const checkFilter = (data, filter, channelMessage) => {
|
const checkFilter = (data, filter, channelMessage) => {
|
||||||
console.log("filter data", data);
|
console.log("filter data", data);
|
||||||
let selected = true;
|
let selected = true;
|
||||||
const {
|
const { mid, file_type, created_at, from_uid, properties } = data;
|
||||||
mid,
|
|
||||||
file_type,
|
|
||||||
created_at,
|
|
||||||
from_uid,
|
|
||||||
properties: { name },
|
|
||||||
} = data;
|
|
||||||
const {
|
const {
|
||||||
name: nameFilter,
|
name: nameFilter,
|
||||||
type: typeFilter,
|
type: typeFilter,
|
||||||
@@ -25,6 +19,7 @@ const checkFilter = (data, filter, channelMessage) => {
|
|||||||
from: fromFilter,
|
from: fromFilter,
|
||||||
channel: channelFilter,
|
channel: channelFilter,
|
||||||
} = filter;
|
} = filter;
|
||||||
|
const name = properties ? properties.name : "";
|
||||||
if (fromFilter && fromFilter != from_uid) {
|
if (fromFilter && fromFilter != from_uid) {
|
||||||
selected = false;
|
selected = false;
|
||||||
}
|
}
|
||||||
@@ -99,13 +94,8 @@ function ResourceManagement({ fileMessages }) {
|
|||||||
if (!data) return null;
|
if (!data) return null;
|
||||||
const isSelected = checkFilter(data, filter, channelMessage);
|
const isSelected = checkFilter(data, filter, channelMessage);
|
||||||
if (!isSelected) return null;
|
if (!isSelected) return null;
|
||||||
const {
|
const { mid, content, created_at, from_uid, properties } = data;
|
||||||
mid,
|
const { name, content_type, size } = properties ?? {};
|
||||||
content,
|
|
||||||
created_at,
|
|
||||||
from_uid,
|
|
||||||
properties: { name, content_type, size },
|
|
||||||
} = data;
|
|
||||||
return (
|
return (
|
||||||
<FileBox
|
<FileBox
|
||||||
preview={view == Views.grid}
|
preview={view == Views.grid}
|
||||||
|
|||||||
@@ -53,13 +53,14 @@ export default function ProfileBasicEditModal({
|
|||||||
description={intro}
|
description={intro}
|
||||||
buttons={
|
buttons={
|
||||||
<>
|
<>
|
||||||
<Button onClick={closeModal}>Cancel</Button>
|
<Button className="cancel" onClick={closeModal}>
|
||||||
|
Cancel
|
||||||
|
</Button>
|
||||||
<Button onClick={handleUpdate}>
|
<Button onClick={handleUpdate}>
|
||||||
{isLoading ? "Updating" : `Done`}
|
{isLoading ? "Updating" : `Done`}
|
||||||
</Button>
|
</Button>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
className="animate__animated animate__fadeInDown animate__faster"
|
|
||||||
>
|
>
|
||||||
<div className="input">
|
<div className="input">
|
||||||
<label htmlFor={valueKey}>{label}</label>
|
<label htmlFor={valueKey}>{label}</label>
|
||||||
|
|||||||
Reference in New Issue
Block a user