Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move redux actions to a separate folder
- Loading branch information
Wojciech Krysiak
authored and
Wojciech Krysiak
committed
Sep 17, 2020
1 parent
9cdb33c
commit 1befad5
Showing
25 changed files
with
197 additions
and
137 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react' | ||
import { Box, H1, Text, Label, Input } from '@admin-bro/design-system' | ||
|
||
const ExamplePage: React.FC = () => ( | ||
<Box variant="grey"> | ||
<Box variant="white"> | ||
<H1>Example page</H1> | ||
<H1>Which you can tailor to your needs</H1> | ||
<Text> | ||
Here you can put whatever you want, like.... | ||
</Text> | ||
<Box> | ||
<Label size="lg">Fancy inputs</Label> | ||
<Input variant="xxl" borderless placeholder="I am fancy" /> | ||
</Box> | ||
</Box> | ||
</Box> | ||
) | ||
|
||
export default ExamplePage |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { NoticeMessageInState } from '../store' | ||
import { NoticeMessage } from '../with-notice' | ||
|
||
export const ADD_NOTICE = 'ADD_NOTICE' | ||
|
||
export const addNotice = (data: NoticeMessage = { message: '' }): { | ||
type: string; | ||
data: NoticeMessageInState; | ||
} => ({ | ||
type: ADD_NOTICE, | ||
data: { | ||
message: data.message, | ||
id: Math.random().toString(36).substr(2, 9), | ||
type: data.type || 'success', | ||
progress: 0, | ||
}, | ||
}) |
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,6 @@ | ||
export const DROP_NOTICE = 'DROP_NOTICE' | ||
|
||
export const dropNotice = (noticeId: string) => ({ | ||
type: 'DROP_NOTICE', | ||
data: { noticeId }, | ||
}) |
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,11 @@ | ||
import { Assets } from '../../../admin-bro-options.interface' | ||
|
||
export const ASSETS_INITIALIZE = 'ASSETS_INITIALIZE' | ||
|
||
export const initializeAssets = (data: Assets): { | ||
type: string; | ||
data: Assets; | ||
} => ({ | ||
type: ASSETS_INITIALIZE, | ||
data, | ||
}) |
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,11 @@ | ||
import { BrandingOptions } from '../../../admin-bro-options.interface' | ||
|
||
export const BRANDING_INITIALIZE = 'BRANDING_INITIALIZE' | ||
|
||
export const initializeBranding = (data: BrandingOptions): { | ||
type: string; | ||
data: BrandingOptions; | ||
} => ({ | ||
type: BRANDING_INITIALIZE, | ||
data, | ||
}) |
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,11 @@ | ||
import { DashboardInState } from '../store' | ||
|
||
export const DASHBOARD_INITIALIZE = 'DASHBOARD_INITIALIZE' | ||
|
||
export const initializeDashboard = (data: DashboardInState): { | ||
type: string; | ||
data: DashboardInState; | ||
} => ({ | ||
type: DASHBOARD_INITIALIZE, | ||
data, | ||
}) |
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,10 @@ | ||
import { Locale } from '../../../locale/config' | ||
|
||
export const LOCALE_INITIALIZE = 'LOCALE_INITIALIZE' | ||
|
||
export const initializeLocale = (data: Locale): { | ||
type: string; data: Locale; | ||
} => ({ | ||
type: LOCALE_INITIALIZE, | ||
data, | ||
}) |
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,10 @@ | ||
import { AdminPage } from '../../../admin-bro-options.interface' | ||
|
||
export const PAGES_INITIALIZE = 'PAGES_INITIALIZE' | ||
|
||
export const initializePages = (data: Array<AdminPage>): { | ||
type: string; data: Array<AdminPage>; | ||
} => ({ | ||
type: PAGES_INITIALIZE, | ||
data, | ||
}) |
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,11 @@ | ||
import { Paths } from '../store' | ||
|
||
export const PATHS_INITIALIZE = 'PATHS_INITIALIZE' | ||
|
||
export const initializePaths = (data: Paths): { | ||
type: string; | ||
data: Paths; | ||
} => ({ | ||
type: PATHS_INITIALIZE, | ||
data, | ||
}) |
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,10 @@ | ||
import ResourceJSON from '../../../backend/decorators/resource-json.interface' | ||
|
||
export const RESOURCES_INITIALIZE = 'RESOURCES_INITIALIZE' | ||
|
||
export const initializeResources = (data: Array<ResourceJSON>): { | ||
type: string; data: Array<ResourceJSON>; | ||
} => ({ | ||
type: RESOURCES_INITIALIZE, | ||
data, | ||
}) |
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,11 @@ | ||
import { VersionProps } from '../../../admin-bro-options.interface' | ||
|
||
export const VERSIONS_INITIALIZE = 'VERSIONS_INITIALIZE' | ||
|
||
export const initializeVersions = (data: VersionProps): { | ||
type: string; | ||
data: VersionProps; | ||
} => ({ | ||
type: VERSIONS_INITIALIZE, | ||
data, | ||
}) |
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,8 @@ | ||
import { CurrentAdmin } from '../../../current-admin.interface' | ||
|
||
export const SESSION_INITIALIZE = 'SESSION_INITIALIZE' | ||
|
||
export const setCurrentAdmin = (data: CurrentAdmin | null = null) => ({ | ||
type: SESSION_INITIALIZE, | ||
data, | ||
}) |
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,10 @@ | ||
|
||
export const SET_NOTICE_PROGRESS = 'SET_NOTICE_PROGRESS' | ||
|
||
export const setNoticeProgress = ({ noticeId, progress }: { | ||
noticeId: string; | ||
progress: number; | ||
}) => ({ | ||
type: SET_NOTICE_PROGRESS, | ||
data: { noticeId, progress }, | ||
}) |
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,13 +1,12 @@ | ||
import { AdminPage } from '../../admin-bro-options.interface' | ||
import AdminBroOptions from '../../admin-bro-options.interface' | ||
|
||
import PageJSON from '../../backend/decorators/page-json.interface' | ||
|
||
const pagesToStore = (pages: Record<string, AdminPage>): Array<PageJSON> => { | ||
const pagesArray = Object.entries(pages).map(([key, adminPage]) => ({ | ||
const pagesToStore = (pages: AdminBroOptions['pages'] = {}): Array<PageJSON> => Object.entries(pages) | ||
.map(([key, adminPage]) => ({ | ||
name: key, | ||
component: adminPage.component, | ||
icon: adminPage.icon, | ||
})) | ||
return pagesArray | ||
} | ||
|
||
export default pagesToStore |
Oops, something went wrong.