-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 #603 from gitroomhq/feat/repeated-post
Add a repeated post
- Loading branch information
Showing
7 changed files
with
128 additions
and
24 deletions.
There are no files selected for viewing
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
35 changes: 35 additions & 0 deletions
35
apps/frontend/src/components/launches/repeat.component.tsx
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,35 @@ | ||
import { FC } from 'react'; | ||
import { Select } from '@gitroom/react/form/select'; | ||
|
||
const list = [ | ||
{ value: 1, label: 'Every Day' }, | ||
{ value: 2, label: 'Every Two Days' }, | ||
{ value: 3, label: 'Every Three Days' }, | ||
{ value: 4, label: 'Every Four Days' }, | ||
{ value: 5, label: 'Every Five Days' }, | ||
{ value: 6, label: 'Every Six Days' }, | ||
{ value: 7, label: 'Every Week' }, | ||
{ value: 14, label: 'Every Two Weeks' }, | ||
{ value: 30, label: 'Every Month' }, | ||
]; | ||
|
||
export const RepeatComponent: FC<{ repeat: number|null, onChange: (newVal: number) => void }> = (props) => { | ||
const { repeat } = props; | ||
return ( | ||
<Select | ||
disableForm={true} | ||
label="" | ||
hideErrors={true} | ||
name="repeat" | ||
value={repeat ? repeat : undefined} | ||
onChange={(e) => props.onChange(Number(e.target.value))} | ||
> | ||
<option>Repeat Post Every...</option> | ||
{list.map((item) => ( | ||
<option key={item.value} value={item.value}> | ||
{item.label} | ||
</option> | ||
))} | ||
</Select> | ||
); | ||
}; |
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
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