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

toolmenu and canvas ui update #42

Merged
merged 4 commits into from
Mar 17, 2024
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 changes: 19 additions & 7 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,41 @@
import React, { useRef } from 'react';
import React, { useEffect, useRef, useState } from 'react';
import { useSelector } from 'react-redux';

import './App.scss';
import Loader from './components/Loader/Loader';
import HeaderMenu from './components/HeaderMenu';
import ToolMenu from './components/ToolMenu/ToolMenu';
import ToolMenu from './components/ToolMenu';
import Library from './components/Library/Library';
import TabBar from './components/TabBar';
import Canvas from './components/Canvas';
import Popup from './components/Popup';

const App = () => {
// REFS
const activeProject = useSelector(state => state.sessionManager.activeCampaignId || '');
const [ isToolMenuOpen, setIsToolMenuOpen ] = useState(!!activeProject);
const toolMenuRef = useRef();

useEffect(() => {
setIsToolMenuOpen(!!activeProject);
}, [activeProject]);

// Disable scrolling
document.body.scroll = 'no';
document.body.style.backgroundColor = 'gray';
document.body.style.overflow = 'hidden';
document.height = window.innerHeight;

// TODO create initialize function and move login stuff into it from Canvas.jsx

return (
<div className='layout'>
<Loader />
<HeaderMenu />
<ToolMenu toolMenuRef={toolMenuRef} />
<HeaderMenu
isToolMenuOpen={isToolMenuOpen}
toggleToolMenu={() => {
if (activeProject) {
setIsToolMenuOpen(!isToolMenuOpen);
}
}} />
<ToolMenu toolMenuRef={toolMenuRef} isOpen={isToolMenuOpen} />
<Library />
<TabBar />
<Canvas toolMenuRef={toolMenuRef} />
Expand Down
1 change: 1 addition & 0 deletions src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
right: 0;
bottom: 0;
left: 0;
background-color: #E8EEF5;
}

input:focus,
Expand Down
Binary file removed src/assets/icons/001-mixer.png
Binary file not shown.
Binary file removed src/assets/icons/003-menu.png
Binary file not shown.
Binary file removed src/assets/icons/004-list.png
Binary file not shown.
Binary file removed src/assets/icons/004-question.png
Binary file not shown.
Binary file removed src/assets/icons/005-home.png
Binary file not shown.
Binary file removed src/assets/icons/006-equalizer.png
Binary file not shown.
Binary file removed src/assets/icons/008-question.png
Binary file not shown.
Binary file removed src/assets/icons/009-warning.png
Binary file not shown.
Binary file removed src/assets/icons/010-settings.png
Binary file not shown.
Binary file removed src/assets/icons/012-left-arrow.png
Binary file not shown.
Binary file removed src/assets/icons/013-right-arrow.png
Binary file not shown.
Binary file removed src/assets/icons/014-question-1.png
Binary file not shown.
Binary file removed src/assets/icons/015-warning-1.png
Binary file not shown.
Binary file removed src/assets/icons/016-home.png
Binary file not shown.
11 changes: 11 additions & 0 deletions src/assets/icons/add-image.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/icons/add2.png
Binary file not shown.
Binary file removed src/assets/icons/alert-32.png
Binary file not shown.
Binary file removed src/assets/icons/close2.png
Binary file not shown.
Binary file removed src/assets/icons/copy-24.png
Binary file not shown.
6 changes: 6 additions & 0 deletions src/assets/icons/copy-card-disabled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/assets/icons/copy-card.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/icons/down-arrow.png
Binary file not shown.
Binary file removed src/assets/icons/edit-24.png
Binary file not shown.
Binary file removed src/assets/icons/edit-32.png
Binary file not shown.
19 changes: 19 additions & 0 deletions src/assets/icons/library.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/icons/lock-24.png
Diff not rendered.
Binary file removed src/assets/icons/lock-32.png
Diff not rendered.
Binary file removed src/assets/icons/menu-32.png
Diff not rendered.
4 changes: 4 additions & 0 deletions src/assets/icons/new-card-disabled.svg
4 changes: 4 additions & 0 deletions src/assets/icons/new-card.svg
3 changes: 3 additions & 0 deletions src/assets/icons/plus.svg
Binary file removed src/assets/icons/redo-32.png
Diff not rendered.
Binary file removed src/assets/icons/remove-24.png
Diff not rendered.
Binary file removed src/assets/icons/reset-32.png
Diff not rendered.
Binary file removed src/assets/icons/save-32.png
Diff not rendered.
Binary file removed src/assets/icons/shrink-24.png
Diff not rendered.
10 changes: 10 additions & 0 deletions src/assets/icons/stat-block.svg
8 changes: 2 additions & 6 deletions src/assets/icons/toggle-left.svg
8 changes: 6 additions & 2 deletions src/assets/icons/toggle-right.svg
Binary file removed src/assets/icons/undo-32.png
Diff not rendered.
Binary file removed src/assets/icons/unlock-24.png
Diff not rendered.
Binary file removed src/assets/icons/unlock-32.png
Diff not rendered.
Binary file removed src/assets/icons/up-arrow.png
Diff not rendered.
Binary file removed src/assets/icons/view-settings-24.png
Diff not rendered.
Binary file removed src/assets/icons/view-settings.png
Diff not rendered.
7 changes: 6 additions & 1 deletion src/components-shared/Dropdowns/ActionDropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ import useOutsideClick from '../../utils/useOutsideClick';
Each item in the items array should be similar to the following object:
{
title: 'Move to unsorted',
type: 'danger',
type: ACTION_TYPE.danger,
callback: () => dispatch(actions.unlinkCardFromView(cardId)),
icon: LibraryIcon,
},
*/

export const ACTION_TYPE = {
danger: 'danger',
disabled: 'disabled',
};

export const ActionDropdown = ({
btnRef,
isOpen,
Expand Down
5 changes: 4 additions & 1 deletion src/components-shared/Dropdowns/ActionDropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ $y: 38px;

.danger {
font-weight: 600 !important;
line-height: 30px !important;
color: #ed5e31 !important;
}

.disabled {
color: #C4C4C4 !important;
}
4 changes: 2 additions & 2 deletions src/components-shared/Dropdowns/ColorDropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useRef } from 'react';

import './ColorDropdown.scss';
import '../../styles/colors.scss'
import { CardColorKeys } from '../../styles/colors';
import { CARD_COLOR_KEYS } from '../../styles/colors';
import useOutsideClick from '../../utils/useOutsideClick';

export const ColorDropdown = ({
Expand All @@ -19,7 +19,7 @@ export const ColorDropdown = ({
if (!isOpen) return null;

let colorList = [];
Object.values(CardColorKeys).forEach(color => {
Object.values(CARD_COLOR_KEYS).forEach(color => {
let className = 'item ' + color;
if (cardColor === color) {
className += ' selected';
Expand Down
Loading
Loading