Skip to content

Commit

Permalink
Merge branch 'dev' into 1-ui-beitrag
Browse files Browse the repository at this point in the history
  • Loading branch information
markusbink committed Aug 20, 2022
2 parents 33066c5 + 3790a41 commit ca89c95
Show file tree
Hide file tree
Showing 16 changed files with 452 additions and 57 deletions.
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Feature request
about: Describe the desired functionality and relevant acceptance criteria
title: ''
labels: ''
assignees: ''

---

**Beschreibung des Features**
Kurze Beschreibung

**Akzeptanzkriterien**
- [ ] Acceptance Criteria 1
- [ ] Acceptance Criteria 2
- [ ] Acceptance Criteria 3

**optional: Screenshots**
47 changes: 4 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,7 @@
# Getting Started with Create React App
# Basisdokument

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
This app enables lawyers to create their previous analogue correspondence in a digital environment, which means that a variety of useful features can be used which eases the proccess of working on cases. The current [list of features](https://github.com/markusbink/basisdokument-implementierung/wiki/3.-Ausgangslage-&-User-Stories) can be seen in the corresponding Wiki.

## Available Scripts
## Running the project locally

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.\
You will also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).
To get started, download the project, `cd` into the root directory and install all dependencies using `npm install` or any other package manager of your choosing. After all dependencies have successfully been installed, you can run `npm start` in your terminal which opens the app in your browser under the following URL [http://localhost:3000](http://localhost:3000).
57 changes: 56 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"react-edit-text": "^5.0.2",
"react-scripts": "5.0.1",
"typescript": "^4.7.4",
"uuid": "^8.3.2",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand Down
17 changes: 13 additions & 4 deletions src/components/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import cx from "classnames";

interface ButtonProps {
icon?: any;
bgColor?: string;
textColor?: string;
size?: "sm" | "md" | "lg";
onClick?: () => void;
children: React.ReactNode;
children?: React.ReactNode;
disabled?: boolean;
hasText?: boolean;
alternativePadding?: string;
}

export const Button: React.FC<ButtonProps> = ({
Expand All @@ -14,15 +18,20 @@ export const Button: React.FC<ButtonProps> = ({
textColor = "text-white",
size = "md",
disabled = false,
hasText = true,
alternativePadding = "",
onClick,
children,
}) => {
return (
<button
onClick={onClick}
className={`flex items-center ${
icon && "gap-3"
} ${size} ${bgColor} ${textColor} ${disabled && "disabled"} font`}
className={cx(
`flex items-center
${icon && "gap-3"} ${size} ${bgColor} ${alternativePadding}
${textColor} ${disabled && "disabled"} font`,
{ "rounded-lg": !hasText }
)}
>
<span>{icon}</span>
{children}
Expand Down
7 changes: 0 additions & 7 deletions src/components/Sidebar.tsx

This file was deleted.

14 changes: 14 additions & 0 deletions src/components/sidebar/Bookmark.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export interface BookmarkProps {
id: string;
title: string;
referenceTo?: string;
}

export const Bookmark: React.FC<BookmarkProps> = (bookmark: BookmarkProps) => {
return (
<div className="font-normal">
<div>{bookmark.title}</div>
<div>{bookmark.referenceTo}</div>
</div>
);
};
20 changes: 20 additions & 0 deletions src/components/sidebar/Hint.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export interface HintProps {
id: string;
title: string;
content?: string;
author: string;
timestamp: Date;
referenceTo?: string;
}

export const Hint: React.FC<HintProps> = (hint: HintProps) => {
return (
<div className="font-normal">
<div>{hint.title}</div>
<div>{hint.content}</div>
<div>{hint.author}</div>
<div>{hint.timestamp.getDate()}</div>
<div>{hint.referenceTo}</div>
</div>
);
};
20 changes: 20 additions & 0 deletions src/components/sidebar/Note.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export interface NoteProps {
id: string;
title: string;
content?: string;
author: string;
timestamp: Date;
referenceTo?: string;
}

export const Note: React.FC<NoteProps> = (note: NoteProps) => {
return (
<div className="font-normal">
<div>{note.title}</div>
<div>{note.content}</div>
<div>{note.author}</div>
<div>{note.timestamp.getDate()}</div>
<div>{note.referenceTo}</div>
</div>
);
};
48 changes: 48 additions & 0 deletions src/components/sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { useState } from "react";
import { SidebarHeader } from "./SidebarHeader";
import { SidebarNotes } from "./SidebarNotes";
import cx from "classnames";
import { SidebarHints } from "./SidebarHints";
import { SidebarBookmarks } from "./SidebarBookmarks";

const sidebars = [
{
name: "Notes",
jsxElem: <SidebarNotes key="Notes"></SidebarNotes>,
},
{
name: "Hints",
jsxElem: <SidebarHints key="Hints"></SidebarHints>,
},
{
name: "Bookmarks",
jsxElem: <SidebarBookmarks key="Bookmarks"></SidebarBookmarks>,
},
];

export const Sidebar = () => {
const [activeSidebar, setActiveSidebar] = useState<string>(sidebars[0].name);
const [sidebarOpen, setSidebarOpen] = useState<boolean>(true);

return (
<aside
className={cx(
"h-full overflow-y-clip shadow-lg divide-y-[1px] divide-lightGrey transition-width duration-300",
{
"w-[65px] overflow-hidden": !sidebarOpen,
"w-[400px]": sidebarOpen,
}
)}
>
<SidebarHeader
setActiveSidebar={setActiveSidebar}
sidebarOpen={sidebarOpen}
setSidebarOpen={setSidebarOpen}
/>
{sidebars.map(
(sidebar) =>
sidebar.name === activeSidebar && sidebarOpen && sidebar.jsxElem
)}
</aside>
);
};
Loading

0 comments on commit ca89c95

Please sign in to comment.