Skip to content
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

Neohuncho/add custom sounds v2 #640

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
41 changes: 28 additions & 13 deletions app/renderer/src/components/Collapse.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
import { SVG } from "components";
import React, { useState } from "react";
import {
StyledCollapse,
StyledCollapseHeading,
StyledCollapseContent,
StyledCollapseContentResponsive,
StyledCollapseHeading,
} from "styles";
import { SVG } from "components";

type Props = {
children?: React.ReactNode;
title?: string;
heightResponsive?: boolean;
};

const Collapse: React.FC<Props> = ({ children }) => {
const Collapse: React.FC<Props> = ({
children,
title,
heightResponsive = false,
}) => {
const [open, setOpen] = useState(false);

const toggleCollapse = () => {
Expand All @@ -19,17 +26,25 @@ const Collapse: React.FC<Props> = ({ children }) => {

return (
<StyledCollapse>
<StyledCollapseHeading
as={"button"}
open={open}
onClick={toggleCollapse}
>
Notification Types
<SVG name="chevron-down" />
</StyledCollapseHeading>
{open && (
<StyledCollapseContent>{children}</StyledCollapseContent>
{title && (
<StyledCollapseHeading
as={"button"}
open={open}
onClick={toggleCollapse}
>
{title}
<SVG name="chevron-down" />
</StyledCollapseHeading>
)}
{open ? (
heightResponsive ? (
<StyledCollapseContentResponsive>
{children}
</StyledCollapseContentResponsive>
) : (
<StyledCollapseContent>{children}</StyledCollapseContent>
)
) : null}
</StyledCollapse>
);
};
Expand Down
8 changes: 4 additions & 4 deletions app/renderer/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@ export { default as RangeLabel } from "./RangeLabel";
export { default as RangeSlider } from "./RangeSlider";
export { default as Time } from "./Time";

export { default as Help } from "./Help";
export { default as Shortcut } from "./Shortcut";
export * from "./Toggler";
export { default as Toggler } from "./Toggler";
export { default as Shortcut } from "./Shortcut";
export { default as Help } from "./Help";

export { default as Header } from "./Header";

export * from "./SVG";
export { default as SVG } from "./SVG";

export { default as Portal } from "./Portal";
export { default as Dimmer } from "./Dimmer";
export { default as Portal } from "./Portal";

export { default as Checkbox } from "./Checkbox";
export { default as Radio } from "./Radio";

export { default as Collapse } from "./Collapse";

export { default as Alert } from "./Alert";
export { default as Updater } from "./Updater";
export { default as NavNotify } from "./NavNotify";
export { default as Updater } from "./Updater";

export * from "./Popper";
export * from "./Preloader";
Expand Down
Loading