Refactor #2
This commit is contained in:
parent
8e3dd6e77d
commit
5ef0cb8a3f
6 changed files with 39 additions and 39 deletions
|
@ -69,6 +69,8 @@ There's a couple of things you can / need to configure to get Dashboard to look
|
|||
|
||||
If you don't require a specific component, just remove the file from your `data`-directory. Dashboard won't render the components whose files are not present. With no files present, only the greeter will be shown.
|
||||
|
||||
If you're running into problems with configuring your files and you can't seem to get them to work, feel free to open an issue, I'd be happy to help! :smile:
|
||||
|
||||
### Apps
|
||||
|
||||
To show the apps you want to show, change `apps.json` to resemble the following:
|
||||
|
|
|
@ -29,7 +29,7 @@ export const AppCategory = ({ name, items }: IAppCategoryProps) => (
|
|||
<App
|
||||
name={app.name}
|
||||
icon={app.icon}
|
||||
URL={app.URL}
|
||||
url={app.url}
|
||||
displayURL={app.displayURL}
|
||||
/>
|
||||
</Item>
|
||||
|
|
|
@ -28,7 +28,7 @@ export interface IBookmarkProps {
|
|||
}
|
||||
|
||||
export interface IBookmarkGroupProps {
|
||||
groupName: string;
|
||||
name: string;
|
||||
items: Array<IBookmarkProps>;
|
||||
}
|
||||
|
||||
|
@ -36,10 +36,10 @@ export interface IBookmarkGroupProps {
|
|||
* Renders a given bookmark group
|
||||
* @param {IBookmarkGroupProps} props - The given props of the bookmark group
|
||||
*/
|
||||
export const BookmarkGroup = ({ groupName, items }: IBookmarkGroupProps) => (
|
||||
export const BookmarkGroup = ({ name, items }: IBookmarkGroupProps) => (
|
||||
<Item>
|
||||
<GroupContainer>
|
||||
<SubHeadline>{groupName}</SubHeadline>
|
||||
<SubHeadline>{name}</SubHeadline>
|
||||
{items.map(({ name, url }, idx) => (
|
||||
<Bookmark key={[name, idx].join("")} href={url}>
|
||||
{name}
|
||||
|
|
|
@ -10,17 +10,15 @@ interface IBookmarkListProps {
|
|||
* Renders a given list of categorized bookmarks
|
||||
* @param {IBookmarkListProps} props - The props of the given bookmark list
|
||||
*/
|
||||
const BookmarkList = ({ groups }: IBookmarkListProps) => {
|
||||
return (
|
||||
<ListContainer>
|
||||
<Headline>Bookmarks</Headline>
|
||||
<ItemList>
|
||||
{groups.map(({ groupName, items }, idx) => (
|
||||
<BookmarkGroup key={[groupName, idx].join("")} groupName={groupName} items={items} />
|
||||
))}
|
||||
</ItemList>
|
||||
</ListContainer>
|
||||
);
|
||||
};
|
||||
const BookmarkList = ({ groups }: IBookmarkListProps) => (
|
||||
<ListContainer>
|
||||
<Headline>Bookmarks</Headline>
|
||||
<ItemList>
|
||||
{groups.map(({ name, items }, idx) => (
|
||||
<BookmarkGroup key={[name, idx].join("")} name={name} items={items} />
|
||||
))}
|
||||
</ItemList>
|
||||
</ListContainer>
|
||||
);
|
||||
|
||||
export default BookmarkList;
|
||||
|
|
|
@ -109,16 +109,11 @@ const getDateString = () => {
|
|||
/**
|
||||
* Renders the Greeter
|
||||
*/
|
||||
const Greeter = () => {
|
||||
let date = getDateString();
|
||||
let greeting = getGreeting();
|
||||
|
||||
return (
|
||||
<GreeterContainer>
|
||||
<DateText>{date}</DateText>
|
||||
<GreetText>{greeting}</GreetText>
|
||||
</GreeterContainer>
|
||||
);
|
||||
};
|
||||
const Greeter = () => (
|
||||
<GreeterContainer>
|
||||
<DateText>{getDateString()}</DateText>
|
||||
<GreetText>{getGreeting()}</GreetText>
|
||||
</GreeterContainer>
|
||||
);
|
||||
|
||||
export default Greeter;
|
||||
|
|
|
@ -90,19 +90,24 @@ const Imprint = ({ imprint }: IImprintComponentProps) => (
|
|||
}
|
||||
}}
|
||||
>
|
||||
<ModalSubHeadline>
|
||||
Information in accordance with section 5 TMG
|
||||
<div>
|
||||
<ModalSubHeadline>
|
||||
Information in accordance with section 5 TMG
|
||||
</ModalSubHeadline>
|
||||
<>
|
||||
{imprint.name && <ImprintField field={imprint.name} />}
|
||||
{imprint.address && <ImprintField field={imprint.address} />}
|
||||
{imprint.email && <ImprintField field={imprint.email} />}
|
||||
{imprint.phone && <ImprintField field={imprint.phone} />}
|
||||
{imprint.url && <ImprintField field={imprint.url} />}
|
||||
</>
|
||||
<Text>
|
||||
{imprint.text}
|
||||
</Text>
|
||||
<>
|
||||
{imprint.name && <ImprintField field={imprint.name} />}
|
||||
{imprint.address && <ImprintField field={imprint.address} />}
|
||||
{imprint.email && <ImprintField field={imprint.email} />}
|
||||
{imprint.phone && <ImprintField field={imprint.phone} />}
|
||||
{imprint.url && <ImprintField field={imprint.url} />}
|
||||
</>
|
||||
</div>
|
||||
<div>
|
||||
<ModalSubHeadline>
|
||||
Imprint
|
||||
</ModalSubHeadline>
|
||||
{imprint.text && <Text>{imprint.text}</Text>}
|
||||
</div>
|
||||
</Modal>
|
||||
</ItemContainer>
|
||||
</ItemList>
|
||||
|
|
Loading…
Reference in a new issue