-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from Thenlie/develop
v1.2.0
- Loading branch information
Showing
21 changed files
with
3,418 additions
and
107 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Button from './Button'; | ||
|
||
export { Button }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import * as React from 'react'; | ||
import './style.css'; | ||
|
||
interface DropDownProps { | ||
name: string; | ||
label: string; | ||
options: string[]; | ||
} | ||
|
||
const DropDown = (props: DropDownProps) => { | ||
return ( | ||
<div className='drop-down-container'> | ||
<label htmlFor={props.name}>{props.label}</label> | ||
<select name={props.name} id={props.name}> | ||
{props.options.map((opt) => ( | ||
<option key={opt}>{opt}</option> | ||
))} | ||
</select> | ||
</div> | ||
); | ||
}; | ||
|
||
export { DropDown }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { DropDown } from './DropDown'; | ||
|
||
export { DropDown }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.drop-down-container { | ||
align-self: flex-start; | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.drop-down-container label { | ||
padding-left: .5em; | ||
} | ||
|
||
select { | ||
background-color: var(--primary); | ||
color: var(--primary-text); | ||
padding: 1em; | ||
margin: .5em; | ||
border-radius: .5em; | ||
} | ||
|
||
select:focus-visible { | ||
outline: 1px auto var(--secondary-text); | ||
background-color: var(--secondary); | ||
} | ||
|
||
option { | ||
appearance: none; | ||
} | ||
|
||
option:focus-visible { | ||
outline: none; | ||
border: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { TextInput } from './TextInput'; | ||
import { TextArea } from './TextArea'; | ||
import { Button } from './Button'; | ||
|
||
export { TextInput, TextArea }; | ||
export { TextInput, TextArea, Button }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
import * as React from 'react'; | ||
import { useState } from 'react'; | ||
import { TextArea, TextInput, Button } from '../components'; | ||
import { generateMarkdown } from '../../../src/utils/generateMarkdown'; | ||
import { InputData } from '../../../src/types'; | ||
import { DropDown } from '../components/DropDown'; | ||
|
||
interface InputScreenProps { | ||
setPage: React.Dispatch<React.SetStateAction<string>>; | ||
setMarkdown: React.Dispatch<React.SetStateAction<string>>; | ||
} | ||
|
||
const InputScreen = (props: InputScreenProps) => { | ||
const [title, setTitle] = useState<string>(''); | ||
const [username, setUsername] = useState<string>(''); | ||
const [email, setEmail] = useState<string>(''); | ||
const [description, setDescription] = useState<string>(''); | ||
// const [license, setLicense] = useState<string>(''); | ||
const [install, setInstall] = useState<string>(''); | ||
const [usage, setUsage] = useState<string>(''); | ||
const [testing, setTesting] = useState<string>(''); | ||
const [contribution, setContribution] = useState<string>(''); | ||
|
||
const licenseOptions = [ | ||
'MIT', | ||
'BSD 2-Clause', | ||
'BSD 3-Clause', | ||
'Boost', | ||
'GNU LGPL', | ||
'GNU AGPL', | ||
'GNU GPL v2', | ||
'GNU GPL v3', | ||
'Mozilla', | ||
'Unlicense', | ||
'none', | ||
]; | ||
|
||
const handleSubmit = () => { | ||
const data: InputData = { | ||
title: title, | ||
email: email, | ||
user: username, | ||
license: 'MIT', | ||
description: description, | ||
install: install, | ||
usage: usage, | ||
contribution: contribution, | ||
test: testing, | ||
}; | ||
|
||
const markdown = generateMarkdown(data); | ||
props.setMarkdown(markdown); | ||
props.setPage('output'); | ||
}; | ||
|
||
return ( | ||
<main> | ||
<form onSubmit={handleSubmit}> | ||
<TextInput | ||
placeholder='Project Title' | ||
name='title' | ||
value={title} | ||
onChange={setTitle} | ||
/> | ||
<TextInput | ||
placeholder='GitHub Username' | ||
name='username' | ||
value={username} | ||
onChange={setUsername} | ||
/> | ||
<TextInput placeholder='Email' name='email' value={email} onChange={setEmail} /> | ||
<DropDown name='license' label='Project License' options={licenseOptions} /> | ||
<TextArea | ||
placeholder='Project Description' | ||
name='description' | ||
value={description} | ||
onChange={setDescription} | ||
/> | ||
<TextArea | ||
placeholder='Installation Steps' | ||
name='install' | ||
value={install} | ||
onChange={setInstall} | ||
/> | ||
<TextArea | ||
placeholder='Usage Instructions' | ||
name='usage' | ||
value={usage} | ||
onChange={setUsage} | ||
/> | ||
<TextArea | ||
placeholder='Testing' | ||
name='testing' | ||
value={testing} | ||
onChange={setTesting} | ||
/> | ||
<TextArea | ||
placeholder='Contributing' | ||
name='contributing' | ||
value={contribution} | ||
onChange={setContribution} | ||
/> | ||
<Button name='submit' type='submit' content='Generate Readme' /> | ||
</form> | ||
</main> | ||
); | ||
}; | ||
|
||
export default InputScreen; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import MDEditor from '@uiw/react-md-editor'; | ||
import * as React from 'react'; | ||
import { useState } from 'react'; | ||
|
||
interface OutputScreenProps { | ||
markdown: string; | ||
} | ||
|
||
const OutputScreen = (props: OutputScreenProps) => { | ||
const [markdown, setMarkdown] = useState(props.markdown); | ||
|
||
return ( | ||
<main> | ||
<p>Output Screen</p> | ||
<MDEditor value={markdown} onChange={setMarkdown} /> | ||
</main> | ||
); | ||
}; | ||
|
||
export default OutputScreen; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import InputScreen from './InputScreen'; | ||
import OutputScreen from './OutputScreen'; | ||
|
||
export { InputScreen, OutputScreen }; |
Oops, something went wrong.