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

Commit

Permalink
Fix prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
AlMcKinlay committed Jul 28, 2020
1 parent 66859a6 commit 4973152
Show file tree
Hide file tree
Showing 5 changed files with 900 additions and 888 deletions.
12 changes: 6 additions & 6 deletions babel-plugin-macros.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
tailwind: {
config: "./src/tailwind.config.js",
styled: "styled-components/macro",
},
};
module.exports = {
tailwind: {
config: "./src/tailwind.config.js",
styled: "styled-components/macro",
},
};
84 changes: 42 additions & 42 deletions src/fileEditor/actions.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
import React from "react";
import tw from "tailwind.macro";
import styled from "styled-components";

const electron = window.require("electron");
const video = electron.remote.require("./video");

const createVideo = (audioPath, image) => {
video.getVideo(audioPath, image.imageBuffer.toString("base64"));
};

const ButtonWrapper = styled.div`
${tw`w-full`}
display: grid;
justify-items: center;
`;

const Button = styled.button`
${tw`font-bold py-2 px-4 border rounded w-1/2 self-center mb-3`};
`;

const PrimaryButton = styled(Button)`
${tw`bg-blue-500 hover:bg-blue-700 text-white border-blue-700`};
`;

const Wrapper = styled.div`
display: grid;
align-items: end;
`;

export default function Actions({ path, setTags, image }) {
return (
<Wrapper>
<ButtonWrapper>
<Button onClick={() => createVideo(path, image)}>Export Video</Button>
</ButtonWrapper>
<ButtonWrapper>
<PrimaryButton onClick={() => setTags()}>Export Tags</PrimaryButton>
</ButtonWrapper>
</Wrapper>
);
}
import React from "react";
import tw from "tailwind.macro";
import styled from "styled-components";

const electron = window.require("electron");
const video = electron.remote.require("./video");

const createVideo = (audioPath, image) => {
video.getVideo(audioPath, image.imageBuffer.toString("base64"));
};

const ButtonWrapper = styled.div`
${tw`w-full`}
display: grid;
justify-items: center;
`;

const Button = styled.button`
${tw`font-bold py-2 px-4 border rounded w-1/2 self-center mb-3`};
`;

const PrimaryButton = styled(Button)`
${tw`bg-blue-500 hover:bg-blue-700 text-white border-blue-700`};
`;

const Wrapper = styled.div`
display: grid;
align-items: end;
`;

export default function Actions({ path, setTags, image }) {
return (
<Wrapper>
<ButtonWrapper>
<Button onClick={() => createVideo(path, image)}>Export Video</Button>
</ButtonWrapper>
<ButtonWrapper>
<PrimaryButton onClick={() => setTags()}>Export Tags</PrimaryButton>
</ButtonWrapper>
</Wrapper>
);
}
42 changes: 21 additions & 21 deletions src/fileEditor/artwork.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import React from "react";
import styled from "styled-components";
import Dropzone from "../components/ArtworkDropzone";

const electron = window.require("electron");
const imageTools = electron.remote.require("./image");

const Wrapper = styled.div`
padding: 0.75rem;
`;

export default function Artwork({ image, setImage }) {
return (
<Wrapper>
<Dropzone
current={image}
selectFile={(file) => setImage(imageTools.toBuffer(file.path))}
></Dropzone>
</Wrapper>
);
}
import React from "react";
import styled from "styled-components";
import Dropzone from "../components/ArtworkDropzone";

const electron = window.require("electron");
const imageTools = electron.remote.require("./image");

const Wrapper = styled.div`
padding: 0.75rem;
`;

export default function Artwork({ image, setImage }) {
return (
<Wrapper>
<Dropzone
current={image}
selectFile={(file) => setImage(imageTools.toBuffer(file.path))}
></Dropzone>
</Wrapper>
);
}
190 changes: 95 additions & 95 deletions src/fileEditor/infoView.js
Original file line number Diff line number Diff line change
@@ -1,95 +1,95 @@
import React from "react";
import tw from "tailwind.macro";
import styled from "styled-components";
import Artwork from "./artwork";

const timestampFormat = "HH:MM:SS";

const Form = styled.form``;

const Wrapper = styled.div`
display: grid;
grid-auto-rows: 1fr 1fr;
height: 100%;
`;

const ItemWrapper = styled.div``;

const TextWrapper = styled.div`
align-self: end;
`;

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 }) {
if (!info.encodedBy) {
info.encodedBy = "McPodcast";
}
return (
<Form>
<Wrapper>
<Artwork
image={info.image}
setImage={(base64) =>
setInfo({
...info,
image: {
mime: "jpeg",
type: { id: 3, name: "front cover" },
imageBuffer: base64,
},
})
}
></Artwork>
<TextWrapper>
<ItemWrapper>
<Text
id="grid-first-name"
type="text"
placeholder="Podcast Title"
value={info.title || ""}
onChange={(e) => setInfo({ ...info, title: e.target.value })}
/>
</ItemWrapper>
<ItemWrapper>
<Text
id="grid-first-name"
type="text"
placeholder="Podcast"
value={info.album || ""}
onChange={(e) => setInfo({ ...info, album: e.target.value })}
/>
</ItemWrapper>
<ItemWrapper>
<Text
id="grid-first-name"
type="text"
placeholder="Encoded By"
value={info.encodedBy || ""}
onChange={(e) => setInfo({ ...info, encodedBy: e.target.value })}
/>
</ItemWrapper>
<ItemWrapper>
<Text
id="grid-first-name"
type="text"
placeholder="Length"
value={info.length || timestampFormat}
onChange={(e) => setInfo({ ...info, length: e.target.value })}
/>
</ItemWrapper>
{/* <ItemWrapper>
<Text
id="grid-first-name"
type="text"
placeholder="Year"
value={info.year}
/>
</ItemWrapper> */}
</TextWrapper>
</Wrapper>
</Form>
);
}
import React from "react";
import tw from "tailwind.macro";
import styled from "styled-components";
import Artwork from "./artwork";

const timestampFormat = "HH:MM:SS";

const Form = styled.form``;

const Wrapper = styled.div`
display: grid;
grid-auto-rows: 1fr 1fr;
height: 100%;
`;

const ItemWrapper = styled.div``;

const TextWrapper = styled.div`
align-self: end;
`;

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 }) {
if (!info.encodedBy) {
info.encodedBy = "McPodcast";
}
return (
<Form>
<Wrapper>
<Artwork
image={info.image}
setImage={(base64) =>
setInfo({
...info,
image: {
mime: "jpeg",
type: { id: 3, name: "front cover" },
imageBuffer: base64,
},
})
}
></Artwork>
<TextWrapper>
<ItemWrapper>
<Text
id="grid-first-name"
type="text"
placeholder="Podcast Title"
value={info.title || ""}
onChange={(e) => setInfo({ ...info, title: e.target.value })}
/>
</ItemWrapper>
<ItemWrapper>
<Text
id="grid-first-name"
type="text"
placeholder="Podcast"
value={info.album || ""}
onChange={(e) => setInfo({ ...info, album: e.target.value })}
/>
</ItemWrapper>
<ItemWrapper>
<Text
id="grid-first-name"
type="text"
placeholder="Encoded By"
value={info.encodedBy || ""}
onChange={(e) => setInfo({ ...info, encodedBy: e.target.value })}
/>
</ItemWrapper>
<ItemWrapper>
<Text
id="grid-first-name"
type="text"
placeholder="Length"
value={info.length || timestampFormat}
onChange={(e) => setInfo({ ...info, length: e.target.value })}
/>
</ItemWrapper>
{/* <ItemWrapper>
<Text
id="grid-first-name"
type="text"
placeholder="Year"
value={info.year}
/>
</ItemWrapper> */}
</TextWrapper>
</Wrapper>
</Form>
);
}
Loading

0 comments on commit 4973152

Please sign in to comment.