Skip to content

Commit

Permalink
feat: ⚡ update app version to 3.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
AmruthPillai committed Aug 25, 2022
1 parent 57dd110 commit 7902f67
Show file tree
Hide file tree
Showing 90 changed files with 1,732 additions and 2,045 deletions.
17 changes: 10 additions & 7 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{
"root": true,
"ignorePatterns": ["/app"],
"parser": "@typescript-eslint/parser",
"extends": ["plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
"extends": ["plugin:@typescript-eslint/recommended"],
"plugins": ["@typescript-eslint/eslint-plugin", "simple-import-sort", "unused-imports"],
"rules": {
// Unused Imports
// ESLint
"no-unused-vars": "off",
// Simple Import Sort
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",

// Unused Imports
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{
Expand All @@ -19,7 +18,11 @@
"argsIgnorePattern": "^_"
}
],
"unused-imports/no-unused-imports": "error",

// Simple Import Sort
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",

// TypeScript ESLint
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-explicit-any": "off",
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [3.6.2](https://github.com/AmruthPillai/Reactive-Resume/compare/v3.5.3...v3.6.2) (2022-08-25)

### Features

- Implement Undo/Redo functionality across the resume builder section

### Improvements

- Update dependencies to the latest version
- Cleanup ESLint configuration, add tailwindCSS formatting

### [3.5.3](https://github.com/AmruthPillai/Reactive-Resume/compare/v3.5.2...v3.5.3) (2022-08-11)

### [3.5.2](https://github.com/AmruthPillai/Reactive-Resume/compare/v3.5.1...v3.5.2) (2022-08-04)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You have complete control over what goes into your resume, how it looks, what co
## Table of Contents

- [Reactive Resume](#reactive-resume)
- [Go to App](https://rxresu.me) | [Docs](https://docs.rxresu.me)
- [Go to App | [Docs](https://docs.rxresu.me)](#go-to-app--docs)
- [Table of Contents](#table-of-contents)
- [Features](#features)
- [Languages](#languages)
Expand Down
15 changes: 13 additions & 2 deletions client/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
{
"extends": ["../.eslintrc.json", "next/core-web-vitals"],
"extends": ["../.eslintrc.json", "next/core-web-vitals", "plugin:tailwindcss/recommended"],
"ignorePatterns": [".next", "__ENV.js"],
"settings": {
"next": {
"rootDir": "client"
}
},
"rules": {
// Next.js
"@next/next/no-img-element": "off",
"@next/next/no-sync-scripts": "off",
"@next/next/no-html-link-for-pages": ["error", "pages"]

// React Hooks
"react-hooks/exhaustive-deps": "off",

// Tailwind CSS
"tailwindcss/no-custom-classname": ["warn", { "whitelist": ["preview-mode", "printer-mode", "markdown"] }]
}
}
48 changes: 35 additions & 13 deletions client/components/build/Center/ArtboardController.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import {
FilterCenterFocus,
InsertPageBreak,
Link,
RedoOutlined,
UndoOutlined,
ViewSidebar,
ZoomIn,
ZoomOut,
Expand All @@ -16,6 +18,7 @@ import { useTranslation } from 'next-i18next';
import toast from 'react-hot-toast';
import { useMutation } from 'react-query';
import { ReactZoomPanPinchRef } from 'react-zoom-pan-pinch';
import { ActionCreators } from 'redux-undo';

import { ServerError } from '@/services/axios';
import { printResumeAsPdf, PrintResumeAsPdfParams } from '@/services/printer';
Expand All @@ -31,14 +34,18 @@ const ArtboardController: React.FC<ReactZoomPanPinchRef> = ({ zoomIn, zoomOut, c
const theme = useTheme();
const dispatch = useAppDispatch();

const resume = useAppSelector((state) => state.resume);
const isDesktop = useMediaQuery(theme.breakpoints.up('sm'));
const pages = useAppSelector((state) => state.resume.metadata.layout);

const { past, present: resume, future } = useAppSelector((state) => state.resume);
const pages = get(resume, 'metadata.layout');
const { left, right } = useAppSelector((state) => state.build.sidebar);
const orientation = useAppSelector((state) => state.build.page.orientation);

const { mutateAsync, isLoading } = useMutation<string, ServerError, PrintResumeAsPdfParams>(printResumeAsPdf);

const handleUndo = () => dispatch(ActionCreators.undo());
const handleRedo = () => dispatch(ActionCreators.redo());

const handleTogglePageBreakLine = () => dispatch(togglePageBreakLine());

const handleTogglePageOrientation = () => dispatch(togglePageOrientation());
Expand Down Expand Up @@ -75,6 +82,20 @@ const ArtboardController: React.FC<ReactZoomPanPinchRef> = ({ zoomIn, zoomOut, c
})}
>
<div className={styles.controller}>
<Tooltip arrow placement="top" title={t<string>('builder.controller.tooltip.undo')}>
<ButtonBase onClick={handleUndo} className={clsx({ 'pointer-events-none opacity-50': past.length < 2 })}>
<UndoOutlined fontSize="medium" />
</ButtonBase>
</Tooltip>

<Tooltip arrow placement="top" title={t<string>('builder.controller.tooltip.redo')}>
<ButtonBase onClick={handleRedo} className={clsx({ 'pointer-events-none opacity-50': future.length === 0 })}>
<RedoOutlined fontSize="medium" />
</ButtonBase>
</Tooltip>

<Divider />

<Tooltip arrow placement="top" title={t<string>('builder.controller.tooltip.zoom-in')}>
<ButtonBase onClick={() => zoomIn(0.25)}>
<ZoomIn fontSize="medium" />
Expand All @@ -97,17 +118,18 @@ const ArtboardController: React.FC<ReactZoomPanPinchRef> = ({ zoomIn, zoomOut, c

{isDesktop && (
<>
{pages.length > 1 && (
<Tooltip arrow placement="top" title={t<string>('builder.controller.tooltip.toggle-orientation')}>
<ButtonBase onClick={handleTogglePageOrientation}>
{orientation === 'vertical' ? (
<AlignHorizontalCenter fontSize="medium" />
) : (
<AlignVerticalCenter fontSize="medium" />
)}
</ButtonBase>
</Tooltip>
)}
<Tooltip arrow placement="top" title={t<string>('builder.controller.tooltip.toggle-orientation')}>
<ButtonBase
onClick={handleTogglePageOrientation}
className={clsx({ 'pointer-events-none opacity-50': pages.length === 1 })}
>
{orientation === 'vertical' ? (
<AlignHorizontalCenter fontSize="medium" />
) : (
<AlignVerticalCenter fontSize="medium" />
)}
</ButtonBase>
</Tooltip>

<Tooltip arrow placement="top" title={t<string>('builder.controller.tooltip.toggle-page-break-line')}>
<ButtonBase onClick={handleTogglePageBreakLine}>
Expand Down
2 changes: 1 addition & 1 deletion client/components/build/Center/Center.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Page from './Page';
const Center = () => {
const orientation = useAppSelector((state) => state.build.page.orientation);

const resume = useAppSelector((state) => state.resume);
const resume = useAppSelector((state) => state.resume.present);
const layout: string[][][] = get(resume, 'metadata.layout');

if (isEmpty(resume)) return null;
Expand Down
2 changes: 1 addition & 1 deletion client/components/build/Center/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const Header = () => {

const { mutateAsync: deleteMutation } = useMutation<void, ServerError, DeleteResumeParams>(deleteResume);

const resume = useAppSelector((state) => state.resume);
const resume = useAppSelector((state) => state.resume.present);
const { left, right } = useAppSelector((state) => state.build.sidebar);

const name = useMemo(() => get(resume, 'name'), [resume]);
Expand Down
2 changes: 1 addition & 1 deletion client/components/build/Center/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Props = PageProps & {
const Page: React.FC<Props> = ({ page, showPageNumbers = false }) => {
const { t } = useTranslation();

const resume = useAppSelector((state) => state.resume);
const resume = useAppSelector((state) => state.resume.present);
const breakLine: boolean = useAppSelector((state) => state.build.page.breakLine);

const theme: Theme = get(resume, 'metadata.theme');
Expand Down
2 changes: 1 addition & 1 deletion client/components/build/LeftSidebar/LeftSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const LeftSidebar = () => {

const isDesktop = useMediaQuery(theme.breakpoints.up('lg'));

const sections = useAppSelector((state) => state.resume.sections);
const sections = useAppSelector((state) => state.resume.present.sections);
const { open } = useAppSelector((state) => state.build.sidebar.left);

const customSections = useMemo(() => getCustomSections(sections), [sections]);
Expand Down
2 changes: 1 addition & 1 deletion client/components/build/LeftSidebar/sections/Basics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const Basics = () => {
<PhotoUpload />
</div>

<div className="grid gap-2 w-full sm:col-span-2">
<div className="grid w-full gap-2 sm:col-span-2">
<ResumeInput label={t<string>('builder.leftSidebar.sections.basics.name.label')} path="basics.name" />

<Button variant="outlined" startIcon={<PhotoFilter />} onClick={handleClick}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const PhotoFilters = () => {

const dispatch = useAppDispatch();

const photo: Photo = useAppSelector((state) => get(state.resume, 'basics.photo'));
const photo: Photo = useAppSelector((state) => get(state.resume.present, 'basics.photo'));
const size: number = get(photo, 'filters.size', 128);
const shape: PhotoShape = get(photo, 'filters.shape', 'square');
const grayscale: boolean = get(photo, 'filters.grayscale', false);
Expand Down
4 changes: 2 additions & 2 deletions client/components/build/LeftSidebar/sections/PhotoUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const PhotoUpload: React.FC = () => {

const fileInputRef = useRef<HTMLInputElement>(null);

const id: number = useAppSelector((state) => get(state.resume, 'id'));
const photo: Photo = useAppSelector((state) => get(state.resume, 'basics.photo'));
const id: number = useAppSelector((state) => get(state.resume.present, 'id'));
const photo: Photo = useAppSelector((state) => get(state.resume.present, 'basics.photo'));

const { mutateAsync: uploadMutation, isLoading } = useMutation<Resume, ServerError, UploadPhotoParams>(uploadPhoto);

Expand Down
4 changes: 2 additions & 2 deletions client/components/build/LeftSidebar/sections/Section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ const Section: React.FC<Props> = ({

const dispatch = useAppDispatch();

const heading = useAppSelector<string>((state) => get(state.resume, `${path}.name`, name));
const visibility = useAppSelector<boolean>((state) => get(state.resume, `${path}.visible`, true));
const heading = useAppSelector<string>((state) => get(state.resume.present, `${path}.name`, name));
const visibility = useAppSelector<boolean>((state) => get(state.resume.present, `${path}.visible`, true));

const handleAdd = () => {
const id = path.split('.')[1];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const SectionSettings: React.FC<Props> = ({ path }) => {

const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null);

const columns = useAppSelector<number>((state) => get(state.resume, `${path}.columns`, 2));
const columns = useAppSelector<number>((state) => get(state.resume.present, `${path}.columns`, 2));

const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
setAnchorEl(event.currentTarget);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const CustomCSS = () => {

const dispatch = useAppDispatch();

const customCSS: CustomCSSType = useAppSelector((state) => get(state.resume, 'metadata.css', {}));
const customCSS: CustomCSSType = useAppSelector((state) => get(state.resume.present, 'metadata.css', {}));

const handleChange = (value: string | undefined) => {
dispatch(setResumeState({ path: 'metadata.css.value', value }));
Expand Down
2 changes: 1 addition & 1 deletion client/components/build/RightSidebar/sections/Export.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useAppSelector } from '@/store/hooks';
const Export = () => {
const { t } = useTranslation();

const resume = useAppSelector((state) => state.resume);
const resume = useAppSelector((state) => state.resume.present);

const { mutateAsync, isLoading } = useMutation<string, ServerError, PrintResumeAsPdfParams>(printResumeAsPdf);

Expand Down
6 changes: 3 additions & 3 deletions client/components/build/RightSidebar/sections/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { DragDropContext, Draggable, DraggableLocation, Droppable, DropResult } from '@hello-pangea/dnd';
import { Add, Close, Restore } from '@mui/icons-material';
import { Button, IconButton, Tooltip } from '@mui/material';
import clsx from 'clsx';
import cloneDeep from 'lodash/cloneDeep';
import get from 'lodash/get';
import { useTranslation } from 'next-i18next';
import { DragDropContext, Draggable, DraggableLocation, Droppable, DropResult } from 'react-beautiful-dnd';

import Heading from '@/components/shared/Heading';
import { useAppDispatch, useAppSelector } from '@/store/hooks';
Expand All @@ -23,8 +23,8 @@ const Layout = () => {

const dispatch = useAppDispatch();

const layout = useAppSelector((state) => state.resume.metadata.layout);
const resumeSections = useAppSelector((state) => state.resume.sections);
const layout = useAppSelector((state) => state.resume.present.metadata.layout);
const resumeSections = useAppSelector((state) => state.resume.present.sections);

const onDragEnd = (dropResult: DropResult) => {
const { source: srcLoc, destination: destLoc } = dropResult;
Expand Down
4 changes: 2 additions & 2 deletions client/components/build/RightSidebar/sections/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ const Settings = () => {

const [confirmReset, setConfirmReset] = useState(false);

const resume = useAppSelector((state) => state.resume);
const resume = useAppSelector((state) => state.resume.present);
const theme = useAppSelector((state) => state.build.theme);
const pages = useAppSelector((state) => state.resume.metadata.layout);
const pages = useAppSelector((state) => state.resume.present.metadata.layout);
const breakLine = useAppSelector((state) => state.build.page.breakLine);
const orientation = useAppSelector((state) => state.build.page.orientation);

Expand Down
2 changes: 1 addition & 1 deletion client/components/build/RightSidebar/sections/Sharing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Sharing = () => {

const [showShortUrl, setShowShortUrl] = useState(false);

const resume = useAppSelector((state) => state.resume);
const resume = useAppSelector((state) => state.resume.present);
const isPublic = useMemo(() => get(resume, 'public'), [resume]);
const url = useMemo(() => getResumeUrl(resume, { withHost: true }), [resume]);
const shortUrl = useMemo(() => getResumeUrl(resume, { withHost: true, shortUrl: true }), [resume]);
Expand Down
4 changes: 2 additions & 2 deletions client/components/build/RightSidebar/sections/Templates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const Templates = () => {

const dispatch = useAppDispatch();

const currentTemplate: string = useAppSelector((state) => get(state.resume, 'metadata.template'));
const currentTemplate: string = useAppSelector((state) => get(state.resume.present, 'metadata.template'));

const handleChange = (template: TemplateMeta) => {
dispatch(setResumeState({ path: 'metadata.template', value: template.id }));
Expand All @@ -31,7 +31,7 @@ const Templates = () => {
<div key={template.id} className={styles.template}>
<div className={clsx(styles.preview, { [styles.selected]: template.id === currentTemplate })}>
<ButtonBase onClick={() => handleChange(template)}>
<Image src={template.preview} alt={template.name} className="rounded-sm" layout="fill" />
<Image src={template.preview} alt={template.name} className="rounded-sm" layout="fill" priority />
</ButtonBase>
</div>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.container {
@apply grid sm:grid-cols-2 gap-4;
@apply grid gap-4 sm:grid-cols-2;
}

.colorOptions {
@apply col-span-2 mb-4;
@apply grid grid-cols-8 gap-y-2 justify-items-center;
@apply grid grid-cols-8 justify-items-center gap-y-2;
}
4 changes: 3 additions & 1 deletion client/components/build/RightSidebar/sections/Theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ const Theme = () => {

const dispatch = useAppDispatch();

const { background, text, primary } = useAppSelector<ThemeType>((state) => get(state.resume, 'metadata.theme'));
const { background, text, primary } = useAppSelector<ThemeType>((state) =>
get(state.resume.present, 'metadata.theme')
);

const handleChange = (property: string, color: string) => {
dispatch(setResumeState({ path: `metadata.theme.${property}`, value: color[0] !== '#' ? `#${color}` : color }));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const Widgets: React.FC<WidgetProps> = ({ label, category }) => {

const dispatch = useAppDispatch();

const { family, size } = useAppSelector<TypographyType>((state) => get(state.resume, 'metadata.typography'));
const { family, size } = useAppSelector<TypographyType>((state) => get(state.resume.present, 'metadata.typography'));

const { data: fonts } = useQuery(FONTS_QUERY, fetchFonts, {
select: (fonts) => fonts.sort((a, b) => a.category.localeCompare(b.category)),
Expand Down
4 changes: 2 additions & 2 deletions client/components/landing/Testimony.module.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.testimony {
@apply grid gap-2;
@apply border-2 rounded p-4 dark:border-neutral-800;
@apply rounded border-2 p-4 dark:border-neutral-800;

blockquote {
@apply text-xs leading-normal text-justify opacity-90;
@apply text-justify text-xs leading-normal opacity-90;
}

figcaption {
Expand Down
4 changes: 2 additions & 2 deletions client/components/shared/BaseModal.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}

.header {
@apply sticky top-0 left-0 right-0 z-50 pt-6 bg-neutral-50 dark:bg-neutral-900;
@apply sticky top-0 left-0 right-0 z-50 bg-neutral-50 pt-6 dark:bg-neutral-900;
@apply flex items-center justify-between;
@apply w-full border-b pb-5 dark:border-white/10;

Expand All @@ -33,7 +33,7 @@
}

.footer {
@apply sticky bottom-0 left-0 right-0 z-50 pb-6 bg-neutral-50 dark:bg-neutral-900;
@apply sticky bottom-0 left-0 right-0 z-50 bg-neutral-50 pb-6 dark:bg-neutral-900;
@apply flex items-center justify-end gap-x-4;
@apply w-full border-t pt-5 dark:border-white/10;
}
Loading

0 comments on commit 7902f67

Please sign in to comment.