From f7ba6588a7d062e3ec82e6413042ce5d8cd075f7 Mon Sep 17 00:00:00 2001 From: Johnny A <5891646+johnny243@users.noreply.github.com> Date: Wed, 6 Jul 2022 17:27:22 -0400 Subject: [PATCH] fix(advanced checklist): improve editor styles (#1221) --- packages/components/package.json | 3 ++- .../package.json | 4 +++- .../src/common/components/ConfirmDialog.tsx | 2 +- .../src/common/components/SubTitle.tsx | 1 + .../components/svg/CheckBoxElementsDefs.scss | 14 +++++++------- .../src/features/tasks/MigrateLegacyContent.tsx | 2 +- .../src/features/tasks/TaskGroup.tsx | 4 ++-- .../src/features/tasks/TaskSectionList.test.tsx | 4 ++-- .../src/features/tasks/TasksSection.tsx | 12 +++--------- .../src/features/tasks/tasks-slice.ts | 4 ++-- .../app/stylesheets/main.scss | 2 +- .../src/Domain/Lists/ExperimentalFeatures.ts | 2 +- yarn.lock | 1 + 13 files changed, 27 insertions(+), 28 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 525ab9a1a..80895f9eb 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -23,7 +23,8 @@ }, "dependencies": { "@standardnotes/features": "workspace:*", - "@standardnotes/styles": "workspace:*" + "@standardnotes/styles": "workspace:*", + "@standardnotes/utils": "workspace:*" }, "devDependencies": { "@standardnotes/deterministic-zip": "^1.2.0", diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/package.json b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/package.json index c99a0c543..bd0c905d9 100644 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/package.json +++ b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/package.json @@ -79,6 +79,9 @@ "^.+\\.module\\.(css|sass|scss)$" ] }, + "dependencies": { + "@standardnotes/utils": "workspace:*" + }, "devDependencies": { "@reach/alert-dialog": "0.16.2", "@reach/menu-button": "0.16.2", @@ -87,7 +90,6 @@ "@reduxjs/toolkit": "1.8.0", "@standardnotes/editor-kit": "2.2.5", "@standardnotes/stylekit": "5.23.0", - "@standardnotes/utils": "workspace:*", "@testing-library/dom": "8.11.3", "@testing-library/jest-dom": "5.16.2", "@testing-library/react": "12.1.4", diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/ConfirmDialog.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/ConfirmDialog.tsx index 50372464c..f6eb58b3d 100644 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/ConfirmDialog.tsx +++ b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/ConfirmDialog.tsx @@ -45,7 +45,7 @@ export const ConfirmDialog: React.FC = ({

{children}

-
+
diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskGroup.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskGroup.tsx index d93c1cedd..2d89b46c4 100644 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskGroup.tsx +++ b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskGroup.tsx @@ -18,7 +18,7 @@ const TaskGroupContainer = styled.div<{ isLast?: boolean }>` border: 1px solid var(--sn-stylekit-border-color); border-radius: 4px; box-sizing: border-box; - padding: 16px; + padding: 16px 18px; margin-bottom: ${({ isLast }) => (!isLast ? '9px' : '0px')}; @media only screen and (max-width: 600px) { @@ -83,7 +83,7 @@ const TaskGroup: React.FC = ({ onTransitionEnd={onTransitionEnd} isLast={isLast} > -
+
{groupName} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskSectionList.test.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskSectionList.test.tsx index ee696db15..c6ba65067 100644 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskSectionList.test.tsx +++ b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskSectionList.test.tsx @@ -60,7 +60,7 @@ it('renders the completed tasks section', () => { const completedTasksSection = screen.getByTestId('completed-tasks-section') expect(completedTasksSection).toBeInTheDocument() - expect(completedTasksSection).toHaveTextContent('Completed tasks') + expect(completedTasksSection).toHaveTextContent('Completed') const taskItems = within(completedTasksSection).getAllByTestId('task-item') expect(taskItems).toHaveLength(1) @@ -100,7 +100,7 @@ it('renders default sections', () => { const completedTasksSection = screen.getByTestId('completed-tasks-section') expect(completedTasksSection).toBeInTheDocument() - expect(completedTasksSection).toHaveTextContent('Completed tasks') + expect(completedTasksSection).toHaveTextContent('Completed') const taskItems = within(completedTasksSection).getAllByTestId('task-item') expect(taskItems).toHaveLength(1) diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TasksSection.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TasksSection.tsx index d23702c0e..11fb37ebf 100644 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TasksSection.tsx +++ b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TasksSection.tsx @@ -6,10 +6,9 @@ import { CSSTransition, TransitionGroup } from 'react-transition-group' import styled from 'styled-components' import { useAppDispatch, useAppSelector, usePrevious } from '../../app/hooks' -import { RoundButton, SubTitle } from '../../common/components' +import { SubTitle } from '../../common/components' import { SectionModel, TaskModel, tasksGroupCollapsed } from './tasks-slice' -import { ChevronDownIcon, ChevronUpIcon } from '../../common/components/icons' import TaskItem from './TaskItem' const SectionHeader = styled.div` @@ -26,7 +25,7 @@ const InnerTasksContainer = styled.div` flex-direction: column; & > *:not(:last-child) { - margin-bottom: 7px; + margin-bottom: 9px; } ` @@ -101,12 +100,7 @@ const TasksSection: React.FC = ({ groupName, tasks, section, {(provided) => ( - {section.name} - {tasks.length > 0 && ( - - {!collapsed ? : } - - )} + {section.name} {!collapsed && (