Skip to content

V2.0 #8

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

Merged
merged 21 commits into from
Mar 14, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
refactor: rename files
  • Loading branch information
lokesh-coder committed Mar 14, 2021
commit fec6571157655af560d340a7db985d22ab688fb9
4 changes: 0 additions & 4 deletions src/@chakra-ui/gatsby-plugin/theme.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { extendTheme } from '@chakra-ui/react';

const theme = extendTheme({
config: {
useSystemColorMode: true,
initialColorMode: 'light',
},
colors: {
primary: '#d7819b',
dark: {
Expand Down
10 changes: 5 additions & 5 deletions src/components/actions.js → src/components/BlobActionBar.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';
import { Container, Box, HStack } from '@chakra-ui/react';
import RandomizerBtn from './randomizer-btn';
import HtmlCodeModalButton from './Settings/HtmlCodeModalButton';
import RandomizerBtn from './Controls/RandomizerButton';
import HtmlCodeModalButton from './Controls/HtmlCodeModalButton';
import { dynamic } from '../state';
import FlutterCodeModalButton from './Settings/FlutterCodeModalButton';
import FlutterCodeModalButton from './Controls/FlutterCodeModalButton';

const Actions = () => (
const BlobActionBar = () => (
<Box mt="10">
<Container centerContent maxW="sm">
<HStack spacing="24px">
Expand All @@ -17,4 +17,4 @@ const Actions = () => (
</Box>
);

export default dynamic(Actions);
export default dynamic(BlobActionBar);
10 changes: 7 additions & 3 deletions src/components/BlobContainer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import React, { useEffect, useState } from 'react';
import React, { useEffect } from 'react';
import { dynamic } from '../state';
import { createFixedBlob, createInitialBlob, setBlobTheme } from '../utilities';
import Blob from './blob';
import {
createFixedBlob,
createInitialBlob,
setBlobTheme,
} from '../utils/blob.utils';
import Blob from './Blob';

const BlobContainer = (props) => {
const { edges, growth, color, colors, type, isOutline, svgPath } = props;
Expand Down
28 changes: 28 additions & 0 deletions src/components/BlobSettingsSection.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from 'react';
import { Box, Divider, HStack } from '@chakra-ui/react';

import RandomnessSlider from './Controls/RandomnessSlider';
import ComplexitySlider from './Controls/ComplexitySlider';
import SolidColorPicker from './Controls/SolidColorPicker';
import GradientColorsPicker from './Controls/GradientColorsPicker';
import OutlineToggleButton from './Controls/OutlineToggleButton';
import ImageSetter from './Controls/ImageSetter';
import PatternSetter from './Controls/PatternSetter';

const BlobSettingsSection = () => (
<Box px={{ lg: 10 }} py="5">
<RandomnessSlider />
<ComplexitySlider />
<Divider my="5" />
<HStack justifyContent="center" alignItems="center">
<SolidColorPicker />
<GradientColorsPicker />
<PatternSetter />
<ImageSetter />
<OutlineToggleButton />
</HStack>
<Divider mt="5" />
</Box>
);

export default BlobSettingsSection;
2 changes: 1 addition & 1 deletion src/components/Common/Hint.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Text,
} from '@chakra-ui/react';
import React from 'react';
import { QuestionIcon } from '../icons';
import { QuestionIcon } from './Icons';

const Hint = ({ text }) => (
<Popover autoFocus={false}>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/Common/Input.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, Input as ChakInput } from '@chakra-ui/react';
import React from 'react';
import { validateHex } from '../../utilities';
import { validateHex } from '../../utils/code.utils';

const Input = ({ value, onEnter }) => (
<Box key={value}>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React from 'react';
import { dynamic } from '../../state';
import Highlight from '../Common/Highlight';
import Modal from '../Common/Modal';
import { FlutterIcon, CopyIcon } from '../icons';
import { FlutterIcon, CopyIcon } from '../Common/Icons';

const FlutterCodeModalButton = ({ edges, growth, seed }) => {
const ID = `${edges}-${growth}-${seed}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Pallette from '../Common/Pallette';
import Popover from '../Common/Popover';
import Input from '../Common/Input';
import Ding from '../Common/Ding';
import { PaletteIcon } from '../icons';
import { PaletteIcon } from '../Common/Icons';

const defaultColors = [
['#e96443', '#904e95'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { dynamic } from '../../state';
import DownloadSVG from '../Common/DownloadSVG';
import Highlight from '../Common/Highlight';
import Modal from '../Common/Modal';
import { HtmlIcon, CopyIcon } from '../icons';
import { formatCode } from '../../utilities';
import { HtmlIcon, CopyIcon } from '../Common/Icons';
import { formatCode } from '../../utils/code.utils';

const HtmlCodeModalButton = ({ seed, edges, growth, svgPath }) => {
const HtmlCodeModalButton = ({ seed, edges, growth }) => {
const ID = `${edges}-${growth}-${seed}`;
const [code, setCode] = useState(null);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { dynamic } from '../../state';
import Popover from '../Common/Popover';
import UrlInput from '../Common/UrlInput';
import Ding from '../Common/Ding';
import { ImageIcon, LandscapeIcon, RightArrowIcon } from '../icons';
import { ImageIcon, LandscapeIcon, RightArrowIcon } from '../Common/Icons';

const ImageSetter = ({ type, image, switchToImage }) => {
const Picker = () => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CheckCircleIcon } from '@chakra-ui/icons';
import React from 'react';
import { dynamic } from '../../state';
import Ding from '../Common/Ding';
import { OutlineIcon } from '../icons';
import { OutlineIcon } from '../Common/Icons';

const OutlineToggleButton = ({ isOutline, toggleOutline }) => (
<Ding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { dynamic } from '../../state';
import Popover from '../Common/Popover';
import * as Patterns from '../../patterns';
import Ding from '../Common/Ding';
import { PatternIcon } from '../icons';
import { PatternIcon } from '../Common/Icons';

const PatternBox = ({ meta, clickHandler, isSelected }) => {
const patternBg = useColorModeValue('A0AEC0', '4A5568');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { Button } from '@chakra-ui/react';
import useSound from 'use-sound';
import boopSfx from '/static/spring.mp3';

import { createRandomBlob } from '../utilities';
import { dynamic } from '../state';
import { createRandomBlob } from '../../utils/blob.utils';
import { dynamic } from '../../state';

const RandomizerBtn = ({ playSound }) => {
const RandomizerButton = ({ playSound }) => {
const [play] = useSound(boopSfx, { volume: 0.5 });
return (
<Button
Expand All @@ -22,4 +22,4 @@ const RandomizerBtn = ({ playSound }) => {
</Button>
);
};
export default dynamic(RandomizerBtn, ['playSound']);
export default dynamic(RandomizerButton, ['playSound']);
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Pallette from '../Common/Pallette';
import Popover from '../Common/Popover';
import Input from '../Common/Input';
import Ding from '../Common/Ding';
import { PaintIcon } from '../icons';
import { PaintIcon } from '../Common/Icons';

const defaultColors = [
'#00cec9',
Expand Down
12 changes: 6 additions & 6 deletions src/components/Common/Footer.js → src/components/Footer.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable react/jsx-wrap-multilines */
import { Box, Link, Text, Button, Center, HStack } from '@chakra-ui/react';
import React from 'react';
import { dynamic } from '../../state';
import Modal from './Modal';
import { dynamic } from '../state';
import Modal from './Common/Modal';
import {
LoIcon,
SoundIcon,
Expand All @@ -11,10 +11,10 @@ import {
UserIcon,
CopyrightIcon,
CreditsIcon,
} from '../icons';
import Credits from '../Misc/Credits';
import SourceCode from '../Misc/SourceCode';
import ThemeSwitch from '../theme-switch';
} from './Common/Icons';
import Credits from './Misc/Credits';
import SourceCode from './Misc/SourceCode';
import ThemeSwitch from './ThemeSwitch';

const Footer = ({ toggleSound, playSound }) => (
<Center my="6">
Expand Down
7 changes: 6 additions & 1 deletion src/components/Misc/SourceCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ import {
Text,
} from '@chakra-ui/react';
import React from 'react';
import { GithubIcon, NpmIcon, FlutterIcon, RightArrowIcon } from '../icons';
import {
GithubIcon,
NpmIcon,
FlutterIcon,
RightArrowIcon,
} from '../Common/Icons';

const SourceCode = () => {
const links = [
Expand Down
6 changes: 3 additions & 3 deletions src/components/NavLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@chakra-ui/react';
import React from 'react';
import { Link as GatbsyLink } from 'gatsby';
import { SavedIcon, TwitterIcon, BookmarkIcon } from './icons';
import { SavedIcon, TwitterIcon, BookmarkIcon } from './Common/Icons';
import { dynamic } from '../state';

const NavLinks = ({ saveBlob }) => {
Expand Down Expand Up @@ -51,9 +51,9 @@ const NavLinks = ({ saveBlob }) => {

<Box as={Text}>
<Button
href="/page-2/"
href="/saved-blobs/"
as={GatbsyLink}
to="/page-2"
to="/saved-blobs"
variant="heavy"
leftIcon={<SavedIcon fontSize="18px" />}
aria-label="Saved blobs"
Expand Down
4 changes: 2 additions & 2 deletions src/components/SavedBlobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {
} from '@chakra-ui/react';
import React, { useEffect } from 'react';
import { dynamic } from '../state';
import Blob from './blob';
import { TrashIcon } from './icons';
import Blob from './Blob';
import { TrashIcon } from './Common/Icons';

const SavedBlobs = ({ savedBlobs = [], deleteBlob, loadBlobs }) => {
const cardHoverBg = useColorModeValue('gray.100', 'gray.700');
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Box, Container, useColorModeValue } from '@chakra-ui/react';
import { Provider } from 'redux-zero/react';
import { store } from '../state';

import Footer from './Common/Footer';
import Footer from './Footer';

const Layout = ({ children }) => {
const theme = useColorModeValue('light', 'dark');
Expand Down
28 changes: 0 additions & 28 deletions src/components/settings.js

This file was deleted.

4 changes: 2 additions & 2 deletions src/pages/404.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Box, Heading, Text } from '@chakra-ui/react';
import React from 'react';
import SEO from '../components/seo';
import Logo from '../components/Logo';
import SEO from '../components/SEO';
import Logo from '../components/Common/Logo';

const NotFoundPage = () => (
<>
Expand Down
14 changes: 7 additions & 7 deletions src/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as React from 'react';
import { Box, Heading, Flex } from '@chakra-ui/react';

import SEO from '../components/seo';
import Settings from '../components/settings';
import Actions from '../components/actions';
import Logo from '../components/Logo';
import SEO from '../components/SEO';
import BlobSettingsSection from '../components/BlobSettingsSection';
import BlobActionBar from '../components/BlobActionBar';
import Logo from '../components/Common/Logo';
import BlobContainer from '../components/BlobContainer';
import NavLinks from '../components/NavLinks';
import Layout from '../components/layout';
import Layout from '../components/Layout';

const IndexPage = () => (
<Layout>
Expand Down Expand Up @@ -39,7 +39,7 @@ const IndexPage = () => (
<Box w={{ base: '100%', lg: 500 }} h={{ lg: 500 }}>
<BlobContainer />
</Box>
<Actions />
<BlobActionBar />
</Box>

<Box
Expand All @@ -61,7 +61,7 @@ const IndexPage = () => (
Generate blobs
</Heading>
</Flex>
<Settings />
<BlobSettingsSection />
<NavLinks />
</Box>
</Box>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/page-2.js → src/pages/saved-blobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { Link } from 'gatsby';

import { Box, Center, Heading, Text } from '@chakra-ui/react';
import { ArrowBackIcon } from '@chakra-ui/icons';
import SEO from '../components/seo';
import SEO from '../components/SEO';

import Logo from '../components/Logo';
import Logo from '../components/Common/Logo';
import SavedBlobs from '../components/SavedBlobs';
import Layout from '../components/layout';
import Layout from '../components/Layout';

const SecondPage = () => (
<Layout>
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy