Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix dashboard , popsearch and add privacy policy page #335

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions ui/src/components/General/PopupSearch/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
import { Input, Modal } from "antd";
import { Input, InputRef, Modal } from "antd";
import { MENU_ITEMS } from "components/Layouts/Menu/utils/constants";
import React, { useState } from "react";
import React, { useContext, useRef, useState } from "react";
import { useNavigate } from "react-router-dom";
import style from "./PopSearch.module.scss";
import Icon from "components/General/Icon";
import { IconName } from "components/General/Icon/utils/types";
import useCombinedKeyPress from "lib/utils/hooks/useCombinedKeyPress";
import { classNames } from "lib/utils/helper";
import { DarkModeContext } from "lib/utils/context/DarkModeProvider";

const { Search } = Input;
const items = MENU_ITEMS.map((item) => item.children).flat();

const PopupSearch: React.FC = () => {
const navigate = useNavigate();
const { isDarkMode } = useContext(DarkModeContext);
const [input, setInput] = useState<string>("");
const [isModalOpen, setIsModalOpen] = useState(false);
const searchInputRef = useRef<InputRef | null>(null);

const handleCancel = () => {
setIsModalOpen(false);
Expand All @@ -24,6 +28,12 @@ const PopupSearch: React.FC = () => {
setIsModalOpen(false);
};

const handleAfterOpen = () => {
if (searchInputRef.current) {
searchInputRef.current.focus();
}
};

useCombinedKeyPress(
() => setIsModalOpen((open) => !open),
["ControlLeft", "KeyK"]
Expand All @@ -35,14 +45,23 @@ const PopupSearch: React.FC = () => {
title="Features"
open={isModalOpen}
footer={[]}
afterOpenChange={handleAfterOpen}
className={isDarkMode ? "dark" : "light"}
>
<Search
placeholder="What do you need?"
value={input}
onChange={(e) => setInput(e.target.value)}
ref={searchInputRef}
allowClear
autoFocus
/>
<div className={style.popsearch__container}>
<div
className={classNames(
style.popsearch__container,
"search_container"
)}
>
{items
.filter((item) =>
item.name.toLowerCase().includes(input.toLowerCase())
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/Layouts/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const Footer: React.FC = () => {
</Link>
</li>
<li>
<Link to={"/privacy"}>
<Link to={"/privacy-policy"}>
<a>Privacy</a>
</Link>
</li>
Expand Down
43 changes: 43 additions & 0 deletions ui/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ h5 {

.ant-layout-content,
.notification-container,
.search_container,
.ant-menu {
&::-webkit-scrollbar {
width: var(--bt-size-8);
Expand Down Expand Up @@ -139,3 +140,45 @@ a:hover {
.ant-typography p {
margin-bottom: 0px !important;
}

/* modal dark mode */
.dark .ant-modal-content {
background-color: #383737 !important;
color: white;
}

.dark .ant-modal-content .ant-modal-header {
background-color: transparent !important;
}

.dark .ant-modal-content .ant-modal-header .ant-modal-title {
color: white;
}

.dark .search_container div:hover {
background-color: #817f7f !important;
}

.dark .ant-input-affix-wrapper {
background-color: transparent !important;
border-color: #afadad !important;
}

.dark .ant-input-affix-wrapper .ant-input {
background-color: transparent !important;
color: white !important;
}

.dark .ant-input-affix-wrapper .ant-input::placeholder {
color: rgb(143, 143, 143) !important;
}

.dark .ant-input-search-button {
background-color: transparent;
color: white !important;
}

.dark .anticon svg {
color: white !important;
}
/* end modal dark mode */
9 changes: 9 additions & 0 deletions ui/src/pages/Footer/PrivacyPolicy/PrivacyPolicy.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,13 @@
padding: 10%;
margin-bottom: 64px;
}

&_activity_list {
list-style-type: circle;
color: red;
}

&_underline {
text-decoration: underline;
}
}
Loading