- run eslint --fix across project

This commit is contained in:
Amruth Pillai
2020-07-09 00:14:13 +05:30
parent a1931f5e36
commit 9045e2983d
72 changed files with 1392 additions and 868 deletions

View File

@ -1,14 +1,14 @@
import React, { useContext } from "react";
import { Helmet } from "react-helmet";
import { useSelector } from "../../../contexts/ResumeContext";
import TemplateContext from "../../../contexts/TemplateContext";
import Onyx from "../../../templates/Onyx";
import styles from "./Artboard.module.css";
import React, { useContext } from 'react';
import { Helmet } from 'react-helmet';
import { useSelector } from '../../../contexts/ResumeContext';
import TemplateContext from '../../../contexts/TemplateContext';
import Onyx from '../../../templates/Onyx';
import styles from './Artboard.module.css';
const Artboard = () => {
const { blocks, colors } = useContext(TemplateContext);
const state = useSelector((state) => state),
{ id, name } = state;
const state = useSelector((s) => s);
const { id, name } = state;
return (
<div>

View File

@ -1,31 +1,29 @@
import { Link } from "gatsby";
import React from "react";
import sections from "../../../data/leftSections";
import Avatar from "../../shared/Avatar";
import Logo from "../../shared/Logo";
import SectionIcon from "../../shared/SectionIcon";
import styles from "./LeftNavbar.module.css";
import { Link } from 'gatsby';
import React from 'react';
import sections from '../../../data/leftSections';
import Avatar from '../../shared/Avatar';
import Logo from '../../shared/Logo';
import SectionIcon from '../../shared/SectionIcon';
import styles from './LeftNavbar.module.css';
const LeftNavbar = () => {
return (
<div className={styles.container}>
<Link to="/app/dashboard">
<Logo size="40px" />
</Link>
const LeftNavbar = () => (
<div className={styles.container}>
<Link to="/app/dashboard">
<Logo size="40px" />
</Link>
<hr className="my-6" />
<hr className="my-6" />
<div className="grid grid-cols-1 gap-8">
{sections.map((x) => (
<SectionIcon key={x.id} section={x} />
))}
</div>
<hr className="mt-auto my-6" />
<Avatar />
<div className="grid grid-cols-1 gap-8">
{sections.map((x) => (
<SectionIcon key={x.id} section={x} />
))}
</div>
);
};
<hr className="mt-auto my-6" />
<Avatar />
</div>
);
export default LeftNavbar;

View File

@ -1,23 +1,21 @@
import React, { Fragment } from "react";
import sections from "../../../data/leftSections";
import LeftNavbar from "./LeftNavbar";
import styles from "./LeftSidebar.module.css";
import React, { Fragment } from 'react';
import sections from '../../../data/leftSections';
import LeftNavbar from './LeftNavbar';
import styles from './LeftSidebar.module.css';
const LeftSidebar = () => {
return (
<div className="flex">
<LeftNavbar />
const LeftSidebar = () => (
<div className="flex">
<LeftNavbar />
<div className={styles.container}>
{sections.map(({ id, name, event, component: Component }) => (
<Fragment key={id}>
<Component id={id} name={name} event={event} />
<hr />
</Fragment>
))}
</div>
<div className={styles.container}>
{sections.map(({ id, name, event, component: Component }) => (
<Fragment key={id}>
<Component id={id} name={name} event={event} />
<hr />
</Fragment>
))}
</div>
);
};
</div>
);
export default LeftSidebar;

View File

@ -1,4 +1,4 @@
import React from "react";
import React from 'react';
const EmptyList = () => (
<div className="py-6 opacity-75 text-center">This list is empty.</div>

View File

@ -1,13 +1,13 @@
import { get, isEmpty } from "lodash";
import moment from "moment";
import React, { useContext } from "react";
import { MdAdd } from "react-icons/md";
import ModalContext from "../../../contexts/ModalContext";
import { useSelector } from "../../../contexts/ResumeContext";
import Button from "../../shared/Button";
import EmptyList from "./EmptyList";
import styles from "./List.module.css";
import ListItem from "./ListItem";
import { get, isEmpty } from 'lodash';
import moment from 'moment';
import React, { useContext } from 'react';
import { MdAdd } from 'react-icons/md';
import ModalContext from '../../../contexts/ModalContext';
import { useSelector } from '../../../contexts/ResumeContext';
import Button from '../../shared/Button';
import EmptyList from './EmptyList';
import styles from './List.module.css';
import ListItem from './ListItem';
const List = ({
path,
@ -27,10 +27,10 @@ const List = ({
const handleEdit = (data) => emitter.emit(event, data);
const formatDateRange = (x) =>
`${moment(x.startDate).format("MMMM Y")}${
`${moment(x.startDate).format('MMMM Y')}${
moment(x.endDate).isValid()
? moment(x.endDate).format("MMMM Y")
: "Present"
? moment(x.endDate).format('MMMM Y')
: 'Present'
}`;
return (
@ -44,11 +44,11 @@ const List = ({
key={x.id}
data={x}
path={path}
title={title || get(x, titlePath, "")}
title={title || get(x, titlePath, '')}
subtitle={
subtitle || get(x, subtitlePath, "") || formatDateRange(x)
subtitle || get(x, subtitlePath, '') || formatDateRange(x)
}
text={text || get(x, textPath, "")}
text={text || get(x, textPath, '')}
className={styles.listItem}
onEdit={() => handleEdit(x)}
isFirst={i === 0}

View File

@ -1,9 +1,9 @@
import { Menu, MenuItem } from "@material-ui/core";
import React, { useState } from "react";
import { IoIosArrowDown, IoIosArrowUp } from "react-icons/io";
import { MdMoreVert } from "react-icons/md";
import { useDispatch } from "../../../contexts/ResumeContext";
import styles from "./ListItem.module.css";
import { Menu, MenuItem } from '@material-ui/core';
import React, { useState } from 'react';
import { IoIosArrowDown, IoIosArrowUp } from 'react-icons/io';
import { MdMoreVert } from 'react-icons/md';
import { useDispatch } from '../../../contexts/ResumeContext';
import styles from './ListItem.module.css';
const ListItem = ({
title,
@ -29,7 +29,7 @@ const ListItem = ({
const handleMoveUp = () => {
dispatch({
type: "on_move_item_up",
type: 'on_move_item_up',
payload: {
path,
value: data,
@ -41,7 +41,7 @@ const ListItem = ({
const handleMoveDown = () => {
dispatch({
type: "on_move_item_down",
type: 'on_move_item_down',
payload: {
path,
value: data,
@ -53,7 +53,7 @@ const ListItem = ({
const handleDelete = () => {
dispatch({
type: "on_delete_item",
type: 'on_delete_item',
payload: {
path,
value: data,

View File

@ -1,12 +1,9 @@
import cx from "classnames";
import React, { useContext } from "react";
import { MdPerson, MdSync, MdSyncDisabled } from "react-icons/md";
import DatabaseContext from "../../../contexts/DatabaseContext";
import styles from "./RightNavbar.module.css";
import React from 'react';
import { MdPerson } from 'react-icons/md';
import styles from './RightNavbar.module.css';
import SyncIndicator from './SyncIndicator';
const RightNavbar = () => {
const { isOffline, isUpdating } = useContext(DatabaseContext);
return (
<div className={styles.container}>
<div className="grid grid-cols-1 gap-6">
@ -16,13 +13,9 @@ const RightNavbar = () => {
/>
</div>
<div className="text-4xl mt-auto">
{isOffline ? (
<MdSyncDisabled className="text-red-600" />
) : (
<MdSync className={cx({ spin: isUpdating })} />
)}
</div>
<hr className="mt-auto my-6" />
<SyncIndicator />
</div>
);
};

View File

@ -1,7 +1,7 @@
import React from "react";
import Layout from "../sections/Layout";
import RightNavbar from "./RightNavbar";
import styles from "./RightSidebar.module.css";
import React from 'react';
import Layout from '../sections/Layout';
import RightNavbar from './RightNavbar';
import styles from './RightSidebar.module.css';
const RightSidebar = () => {
return (

View File

@ -0,0 +1,20 @@
import cx from 'classnames';
import React, { useContext } from 'react';
import { MdSync, MdSyncDisabled } from 'react-icons/md';
import DatabaseContext from '../../../contexts/DatabaseContext';
const SyncIndicator = () => {
const { isOffline, isUpdating } = useContext(DatabaseContext);
return (
<div className="text-4xl">
{isOffline ? (
<MdSyncDisabled className="text-red-600" />
) : (
<MdSync className={cx({ spin: isUpdating })} />
)}
</div>
);
};
export default SyncIndicator;

View File

@ -1,8 +1,8 @@
import React from "react";
import Heading from "../../shared/Heading";
import List from "../lists/List";
import React from 'react';
import Heading from '../../shared/Heading';
import List from '../lists/List';
const Awards = ({ id, name, event, state }) => {
const Awards = ({ id, name, event }) => {
const path = `${id}.items`;
return (

View File

@ -1,8 +1,8 @@
import React from "react";
import Heading from "../../shared/Heading";
import List from "../lists/List";
import React from 'react';
import Heading from '../../shared/Heading';
import List from '../lists/List';
const Certifications = ({ id, name, event, state }) => {
const Certifications = ({ id, name, event }) => {
const path = `${id}.items`;
return (

View File

@ -1,8 +1,8 @@
import React from "react";
import Heading from "../../shared/Heading";
import List from "../lists/List";
import React from 'react';
import Heading from '../../shared/Heading';
import List from '../lists/List';
const Education = ({ id, name, event, state }) => {
const Education = ({ id, name, event }) => {
const path = `${id}.items`;
return (

View File

@ -1,8 +1,8 @@
import React, { useContext } from "react";
import { DragDropContext, Draggable, Droppable } from "react-beautiful-dnd";
import TemplateContext from "../../../contexts/TemplateContext";
import Heading from "../../shared/Heading";
import styles from "./Layout.module.css";
import React, { useContext } from 'react';
import { DragDropContext, Draggable, Droppable } from 'react-beautiful-dnd';
import TemplateContext from '../../../contexts/TemplateContext';
import Heading from '../../shared/Heading';
import styles from './Layout.module.css';
const Layout = () => {
const { blocks, onDragEnd } = useContext(TemplateContext);
@ -20,11 +20,11 @@ const Layout = () => {
<DragDropContext onDragEnd={onDragEnd}>
{blocks.map((el, ind) => (
<Droppable key={ind} droppableId={`${ind}`}>
{(provided) => (
{(dropProvided) => (
<div
ref={provided.innerRef}
ref={dropProvided.innerRef}
className={styles.droppable}
{...provided.droppableProps}
{...dropProvided.droppableProps}
>
<div className="grid gap-3">
<span className="uppercase font-semibold text-xs">
@ -36,12 +36,12 @@ const Layout = () => {
draggableId={item.id}
index={index}
>
{(provided) => (
{(dragProvided) => (
<div
ref={provided.innerRef}
ref={dragProvided.innerRef}
className={styles.draggable}
{...provided.draggableProps}
{...provided.dragHandleProps}
{...dragProvided.draggableProps}
{...dragProvided.dragHandleProps}
>
{item.name}
</div>
@ -49,7 +49,7 @@ const Layout = () => {
</Draggable>
))}
</div>
{provided.placeholder}
{dropProvided.placeholder}
</div>
)}
</Droppable>

View File

@ -1,6 +1,6 @@
import React from "react";
import Heading from "../../shared/Heading";
import Input from "../../shared/Input";
import React from 'react';
import Heading from '../../shared/Heading';
import Input from '../../shared/Input';
const Objective = () => {
return (

View File

@ -1,7 +1,7 @@
import React from "react";
import Heading from "../../shared/Heading";
import Input from "../../shared/Input";
import PhotoUpload from "../../shared/PhotoUpload";
import React from 'react';
import Heading from '../../shared/Heading';
import Input from '../../shared/Input';
import PhotoUpload from '../../shared/PhotoUpload';
const Profile = () => {
return (

View File

@ -1,6 +1,6 @@
import React from "react";
import Heading from "../../shared/Heading";
import List from "../lists/List";
import React from 'react';
import Heading from '../../shared/Heading';
import List from '../lists/List';
const Skills = ({ id, name, event }) => {
const path = `${id}.items`;

View File

@ -1,6 +1,6 @@
import React from "react";
import Heading from "../../shared/Heading";
import List from "../lists/List";
import React from 'react';
import Heading from '../../shared/Heading';
import List from '../lists/List';
const Social = ({ id, name, event }) => {
const path = `${id}.items`;

View File

@ -1,8 +1,8 @@
import React from "react";
import Heading from "../../shared/Heading";
import List from "../lists/List";
import React from 'react';
import Heading from '../../shared/Heading';
import List from '../lists/List';
const Work = ({ id, name, event, state }) => {
const Work = ({ id, name, event }) => {
const path = `${id}.items`;
return (