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

feat: community events | Create The UI Of Creating New Event #591

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
26,284 changes: 13,142 additions & 13,142 deletions package-lock.json

Large diffs are not rendered by default.

166 changes: 83 additions & 83 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,86 +1,86 @@
{
"homepage": "https://thecyberhub.org/",
"name": "thecyberhub.org",
"private": true,
"version": "0.53.14",
"scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -d dist",
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"prepare": "husky install"
},
"dependencies": {
"@radix-ui/react-slot": "^1.0.1",
"@reduxjs/toolkit": "^1.9.1",
"@uiw/react-md-editor": "^4.0.1",
"axios": "^1.2.1",
"date-fns": "^2.30.0",
"dompurify": "^3.0.5",
"dotenv": "^16.0.3",
"fs-extra": "^11.1.1",
"highlight.js": "^11.8.0",
"html2canvas": "^1.4.1",
"jspdf": "^2.5.1",
"moment": "^2.29.4",
"path-to-regexp": "^6.2.1",
"react": "^18.2.0",
"react-calendar-heatmap": "^1.9.0",
"react-chartjs-2": "^5.2.0",
"react-chatbot-kit": "^2.1.2",
"react-day-picker": "^8.7.1",
"react-dom": "^18.2.0",
"react-dropzone": "^14.2.3",
"react-helmet": "^6.1.0",
"react-icons": "^4.12.0",
"react-infinite-scroll-component": "^6.1.0",
"react-markdown": "^8.0.7",
"react-quill": "^2.0.0",
"react-redux": "^8.0.4",
"react-router": "^6.15.0",
"react-router-dom": "^6.16.0",
"react-scroll": "^1.8.8",
"react-spinners": "^0.13.6",
"react-spinners-kit": "^1.9.1",
"react-syntax-highlighter": "^15.5.0",
"react-toastify": "^9.1.1",
"react-transition-group": "^4.4.5",
"rehype-sanitize": "^6.0.0",
"remark-gfm": "^3.0.1",
"sass": "^1.55.0",
"styled-components": "^5.3.6"
},
"devDependencies": {
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@vitejs/plugin-react": "^1.3.0",
"autoprefixer": "^10.4.16",
"eslint": "^8.26.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.3.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.31.10",
"gh-pages": "^4.0.0",
"husky": "^8.0.3",
"lint-staged": "^13.0.3",
"postcss": "^8.4.32",
"prettier": "^2.7.1",
"tailwindcss": "^3.3.6",
"vite": "^3.1.8"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
"homepage": "https://thecyberhub.org/",
"name": "thecyberhub.org",
"private": true,
"version": "0.53.14",
"scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -d dist",
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"prepare": "husky install"
},
"dependencies": {
"@radix-ui/react-slot": "^1.0.1",
"@reduxjs/toolkit": "^1.9.1",
"@uiw/react-md-editor": "^4.0.1",
"axios": "^1.2.1",
"date-fns": "^2.30.0",
"dompurify": "^3.0.5",
"dotenv": "^16.0.3",
"fs-extra": "^11.1.1",
"highlight.js": "^11.8.0",
"html2canvas": "^1.4.1",
"jspdf": "^2.5.1",
"moment": "^2.29.4",
"path-to-regexp": "^6.2.1",
"react": "^18.2.0",
"react-calendar-heatmap": "^1.9.0",
"react-chartjs-2": "^5.2.0",
"react-chatbot-kit": "^2.1.2",
"react-day-picker": "^8.7.1",
"react-dom": "^18.2.0",
"react-dropzone": "^14.2.3",
"react-helmet": "^6.1.0",
"react-icons": "^4.12.0",
"react-infinite-scroll-component": "^6.1.0",
"react-markdown": "^8.0.7",
"react-quill": "^2.0.0",
"react-redux": "^8.0.4",
"react-router": "^6.15.0",
"react-router-dom": "^6.16.0",
"react-scroll": "^1.8.8",
"react-spinners": "^0.13.6",
"react-spinners-kit": "^1.9.1",
"react-syntax-highlighter": "^15.5.0",
"react-toastify": "^9.1.1",
"react-transition-group": "^4.4.5",
"rehype-sanitize": "^6.0.0",
"remark-gfm": "^3.0.1",
"sass": "^1.55.0",
"styled-components": "^5.3.6"
},
"devDependencies": {
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@vitejs/plugin-react": "^1.3.0",
"autoprefixer": "^10.4.16",
"eslint": "^8.26.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.3.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.31.10",
"gh-pages": "^4.0.0",
"husky": "^8.0.3",
"lint-staged": "^13.0.3",
"postcss": "^8.4.32",
"prettier": "^2.7.1",
"tailwindcss": "^3.3.6",
"vite": "^3.1.8"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,jsx}": [
"eslint --cache --fix",
"git add"
],
"*.{js,jsx,css,md}": "prettier --write"
}
},
"lint-staged": {
"*.{js,jsx}": [
"eslint --cache --fix",
"git add"
],
"*.{js,jsx,css,md}": "prettier --write"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@ import React from "react";

import CommunityEvents from "../../CommunityEvents";
import {
AiFillClockCircleIcon,
AiOutlineCloseCircleIcon,
BiUserPlusIcon,
CommunityEventsContainer,
GoProjectSymlinkIcon,
MdLocationOnIcon,
TbEditCircleIcon,
} from "./ManageCommunityEventsElements";

const ManageCommunityEvents = () => {
const actionsIcon = [
{ icon: AiFillClockCircleIcon, text: "Reschedule Event" },
{ icon: MdLocationOnIcon, text: "Edit location" },
{ icon: GoProjectSymlinkIcon, text: "Change Event Link" },
{ icon: TbEditCircleIcon, text: "Edit Details" },
{ icon: BiUserPlusIcon, text: "Invite people" },
{ icon: AiOutlineCloseCircleIcon, text: "Cancel event" },
];
Expand All @@ -26,7 +22,6 @@ const ManageCommunityEvents = () => {
modify
actionsIcon={actionsIcon}
/>
;
</CommunityEventsContainer>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import styled from "styled-components";
import { AiFillClockCircle, AiOutlineCloseCircle } from "react-icons/ai";
import { MdLocationOn } from "react-icons/md";
import { BiUserPlus } from "react-icons/bi";
import { GoProjectSymlink } from "react-icons/go";
import { TbEditCircle } from "react-icons/tb";

export const CommunityEventsContainer = styled.div`
width: 100%;
Expand All @@ -17,7 +16,6 @@ const createStyledIcon = (IconComponent) => {
};

export const AiFillClockCircleIcon = createStyledIcon(AiFillClockCircle);
export const MdLocationOnIcon = createStyledIcon(MdLocationOn);
export const TbEditCircleIcon = createStyledIcon(TbEditCircle);
export const BiUserPlusIcon = createStyledIcon(BiUserPlus);
export const AiOutlineCloseCircleIcon = createStyledIcon(AiOutlineCloseCircle);
export const GoProjectSymlinkIcon = createStyledIcon(GoProjectSymlink);
4 changes: 2 additions & 2 deletions src/components/Common/InputEditor/InputEditor.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useState } from "react";
import { InputEditorContainer, InputEditorTheInput } from "./InputEditorElements";

const InputEditor = ({ content, label, onCopyChanges }) => {
const InputEditor = ({ content, label, onCopyChanges, placeholder, inputType }) => {
const [value, setValue] = useState("");

useEffect(() => {
Expand All @@ -15,7 +15,7 @@ const InputEditor = ({ content, label, onCopyChanges }) => {

return (
<InputEditorContainer>
<InputEditorTheInput type="text" onChange={handleChange} value={value} placeholder={"Note Heading"} />
<InputEditorTheInput type={inputType} onChange={handleChange} value={value} placeholder={placeholder} />
</InputEditorContainer>
);
};
Expand Down
37 changes: 26 additions & 11 deletions src/components/CommunityEvents/CommunityEvents.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ import {
NoDataComponent,
EventList,
EventNote,
CommunityEventHeaderContainer,
} from "./CommunityEventsElement";
import eventsData from "./events.json";
import NoDataFound from "../../assets/images/no_data_found.svg";
import { EventItemList } from "./EventItemList";
import { RouterNavCreateButton } from "../Header/Navbar/NavbarElements";
import CreateCommunityEvent from "./CreateCommunityEvent";

const CommunityEvents = ({
pageHeader,
Expand All @@ -25,6 +28,7 @@ const CommunityEvents = ({
}) => {
const events = eventsData.events;
const [isActiveTab, setActiveTab] = useState(0);
const [openCreatingNewEvent, setOpenCreatingNewEvent] = useState(false);
const today = new Date();
const todayString = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, "0")}-${String(
today.getDate(),
Expand All @@ -44,18 +48,29 @@ const CommunityEvents = ({
<Container>
<Header>{title}</Header>
<SubHeader>{subtitle}</SubHeader>
<Tabs>
{tabNames.map((tab, index) => (
<button
onClick={() => setActiveTab(index)}
key={tab.id}
className={isActiveTab === index ? "active" : ""}
>
{tab.status}
</button>
))}
</Tabs>
<CommunityEventHeaderContainer>
<Tabs>
{tabNames.map((tab, index) => (
<button
onClick={() => setActiveTab(index)}
key={tab.id}
className={isActiveTab === index ? "active" : ""}
>
{tab.status}
</button>
))}
</Tabs>
{modify && (
<RouterNavCreateButton noCenter onClick={() => setOpenCreatingNewEvent(true)}>
Create Event
</RouterNavCreateButton>
)}
</CommunityEventHeaderContainer>

<EventList>
{modify && openCreatingNewEvent && (
<CreateCommunityEvent setOpenCreatingNewEvent={setOpenCreatingNewEvent} />
)}
{filteredEvents.length !== 0 ? (
filteredEvents.map((data, index) => {
const dateObject = new Date(data.date);
Expand Down
5 changes: 5 additions & 0 deletions src/components/CommunityEvents/CommunityEventsElement.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,8 @@ export const BiSolidChevronUpIcon = createStyledIcon(BiSolidChevronUp);
export const AiFillExclamationCircleIcon = createStyledIcon(AiFillExclamationCircle);
export const AiFillClockCircleIcon = createStyledIcon(AiFillClockCircle);
export const MdLocationOnIcon = createStyledIcon(MdLocationOn);

export const CommunityEventHeaderContainer = styled.div`
display: flex;
justify-content: space-between;
`;
Loading