Skip to content
This repository has been archived by the owner on Aug 14, 2023. It is now read-only.

Commit

Permalink
Rename and reorganise some sections to be more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
AlMcKinlay committed Sep 2, 2021
1 parent 0ee2fa5 commit 74c053b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 17 deletions.
3 changes: 2 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import Dropzone from "./components/PodcastDropzone";
import FileView from "./fileEditor/FileView";
import styled from "styled-components";
import { StoreProvider } from "./store/store";
import tw from "twin.macro";

const Wrapper = styled.div`
width: 100vw;
height: 100vh;
padding: 10px;
${tw`p-3`};
`;

function App() {
Expand Down
4 changes: 2 additions & 2 deletions src/fileEditor/artwork.js → src/components/Artwork.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import styled from "styled-components";
import Dropzone from "../components/ArtworkDropzone";
import ArtworkDropzone from "./ArtworkDropzone";

const electron = window.require("electron");
const imageTools = electron.remote.require("./image");
Expand All @@ -12,7 +12,7 @@ const Wrapper = styled.div`
export default function Artwork({ image, setImage }) {
return (
<Wrapper>
<Dropzone current={image} selectFile={(file) => setImage(imageTools.toBuffer(file.path))}></Dropzone>
<ArtworkDropzone current={image} selectFile={(file) => setImage(imageTools.toBuffer(file.path))} />
</Wrapper>
);
}
2 changes: 1 addition & 1 deletion src/components/ArtworkDropzone.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const Overlay = styled.div`
align-items: center;
`;

export default function PodcastDropzone({ current, selectFile }) {
export default function ArtworkDropzone({ current, selectFile }) {
const onDrop = useCallback((acceptedFiles) => selectFile(acceptedFiles[0]), [selectFile]);
const { getRootProps, getInputProps, isDragActive } = useDropzone({ onDrop });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const timeToS = (time) => {

Modal.setAppElement("#root");

export default function Actions({ path, setTags, image, length, chapters }) {
export default function ActionsPanel({ path, setTags, image, length, chapters }) {
const [isCreatingVideo, setIsCreatingVideo] = useState(false);
const [err, setErr] = useState(undefined);
const [modalOpen, setModalOpen] = useState(false);
Expand Down
17 changes: 7 additions & 10 deletions src/fileEditor/FileView.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useState } from "react";
import InfoView from "./infoView";
import InfoPanel from "./InfoPanel";
import styled from "styled-components";
import Actions from "./actions";
import ActionsPanel from "./ActionsPanel";
import LogView from "./LogView";
import ChapterPanel from "./ChapterPanel";
import tw from "twin.macro";
Expand Down Expand Up @@ -39,21 +39,18 @@ export default function FileView({ file: { path } }) {

return tags ? (
<Wrapper>
<InfoView info={tags} setInfo={(tags) => setTags(tags)}></InfoView>
<ChapterPanel
chapters={tags.chapter}
setChapters={(newChapters) => setTags({ ...tags, chapter: newChapters })}
></ChapterPanel>
<InfoPanel info={tags} setInfo={(tags) => setTags(tags)}></InfoPanel>
<ChapterPanel chapters={tags.chapter} setChapters={(newChapters) => setTags({ ...tags, chapter: newChapters })} />

<RightPanel>
<LogView></LogView>
<Actions
<LogView />
<ActionsPanel
path={path}
setTags={() => id3.setTags(path, tags)}
image={tags.image}
length={tags.length}
chapters={tags.chapter}
></Actions>
/>
</RightPanel>
</Wrapper>
) : (
Expand Down
4 changes: 2 additions & 2 deletions src/fileEditor/infoView.js → src/fileEditor/InfoPanel.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect } from "react";
import tw from "twin.macro";
import styled from "styled-components";
import Artwork from "./artwork";
import Artwork from "../components/Artwork";

const timestampFormat = "HH:MM:SS";

Expand All @@ -23,7 +23,7 @@ const Text = styled.input`
${tw`appearance-none block w-full bg-gray-200 text-gray-700 border rounded py-3 px-4 mb-3 leading-tight focus:outline-none focus:bg-white`};
`;

export default function InfoView({ info, setInfo }) {
export default function InfoPanel({ info, setInfo }) {
useEffect(() => {
if (!info.encodedBy) {
setInfo({ ...info, encodedBy: "McPodcast" });
Expand Down

0 comments on commit 74c053b

Please sign in to comment.