Skip to content

Commit

Permalink
chore(examples): remove indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
brionmario committed Oct 21, 2024
1 parent adc4fc4 commit 30304ab
Show file tree
Hide file tree
Showing 18 changed files with 64 additions and 159 deletions.
9 changes: 6 additions & 3 deletions examples/multi-brand-identity/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@

import {AppBar, ColorModeToggle, Toolbar, ThemeProvider, IconButton, Theme, Tooltip} from '@oxygen-ui/react';
import {ReactElement, useReducer, useState} from 'react';
import {BrandingActions, brandingReducer, DefaultTheme} from './branding';
import {BrandSwitcher, BuildingIcon, OrganizationSelectionDialog} from './components';
import {LoginPage} from './pages';
import brandingReducer, {BrandingActions} from './branding/store/branding-reducer';
import DefaultTheme from './branding/themes/DefaultTheme';
import BrandSwitcher from './components/BrandSwitcher';
import BuildingIcon from './components/icons/BuildingIcon';
import OrganizationSelectionDialog from './components/OrganizationSelectionDialog';
import LoginPage from './pages/LoginPage';

const App = (): ReactElement => {
const [theme, dispatch] = useReducer(brandingReducer, DefaultTheme as never);
Expand Down
20 changes: 0 additions & 20 deletions examples/multi-brand-identity/src/branding/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@
*/

import {Theme} from '@oxygen-ui/react';
import {AsgardeoTheme, BallerinaTheme, ChoreoTheme, DefaultTheme} from '../themes';
import AsgardeoTheme from '../themes/AsgardeoTheme';
import BallerinaTheme from '../themes/BallerinaTheme';
import ChoreoTheme from '../themes/ChoreoTheme';
import DefaultTheme from '../themes/DefaultTheme';

export enum BrandingActions {
ChangeTheme = 'ChangeTheme',
}

export const brandingReducer = (theme: Theme, action: any): Theme => {
const brandingReducer = (theme: Theme, action: any): Theme => {
switch (action.type) {
case BrandingActions.ChangeTheme: {
if (action.brand === 'WSO2') {
Expand All @@ -50,3 +53,5 @@ export const brandingReducer = (theme: Theme, action: any): Theme => {
}
}
};

export default brandingReducer;
19 changes: 0 additions & 19 deletions examples/multi-brand-identity/src/branding/store/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import tokens from '@oxygen-ui/primitives/dist/design-tokens/web/asgardeo/es/tokens';
import {extendTheme, Theme} from '@oxygen-ui/react';

export const AsgardeoTheme: Theme = extendTheme({
const AsgardeoTheme: Theme = extendTheme({
colorSchemes: {
dark: {
brand: {
Expand Down Expand Up @@ -256,3 +256,5 @@ export const AsgardeoTheme: Theme = extendTheme({
},
},
});

export default AsgardeoTheme;
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import {extendTheme, Theme} from '@oxygen-ui/react';

export const BallerinaTheme: Theme = extendTheme({
const BallerinaTheme: Theme = extendTheme({
colorSchemes: {
dark: {
brand: {
Expand Down Expand Up @@ -144,3 +144,5 @@ export const BallerinaTheme: Theme = extendTheme({
},
},
});

export default BallerinaTheme;
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import tokens from '@oxygen-ui/primitives/dist/design-tokens/web/choreo/es/tokens';
import {extendTheme, Theme} from '@oxygen-ui/react';

export const ChoreoTheme: Theme = extendTheme({
const ChoreoTheme: Theme = extendTheme({
components: {
MuiTooltip: {
styleOverrides: {
Expand Down Expand Up @@ -414,3 +414,5 @@ export const ChoreoTheme: Theme = extendTheme({
},
},
});

export default ChoreoTheme;
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import darkTokens from '@oxygen-ui/primitives/dist/design-tokens/web/oxygen/es/d
import lightTokens from '@oxygen-ui/primitives/dist/design-tokens/web/oxygen/es/tokens';
import {extendTheme, Theme} from '@oxygen-ui/react';

export const DefaultTheme: Theme = extendTheme({
const DefaultTheme: Theme = extendTheme({
colorSchemes: {
dark: {
brand: {
Expand Down Expand Up @@ -136,3 +136,5 @@ export const DefaultTheme: Theme = extendTheme({
].join(','),
},
});

export default DefaultTheme;
22 changes: 0 additions & 22 deletions examples/multi-brand-identity/src/branding/themes/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
* under the License.
*/

import {ToggleButtonGroup, ToggleButton, Paper, Tooltip} from '@oxygen-ui/react';
import {ToggleButtonGroup, ToggleButton} from '@oxygen-ui/react';
import Paper from '@oxygen-ui/react/Paper';
import Tooltip from '@oxygen-ui/react/Tooltip';
import {useState, MouseEvent, ReactElement} from 'react';

interface Brand {
Expand Down Expand Up @@ -62,7 +64,7 @@ export interface BrandSwitcherProps {
onBrandChange?: (brand: string) => void;
}

export const BrandSwitcher = (props: BrandSwitcherProps): ReactElement => {
const BrandSwitcher = (props: BrandSwitcherProps): ReactElement => {
const {onBrandChange} = props;

const [activeBrand, setActiveBrand] = useState<string>(BRANDS[0].name);
Expand Down Expand Up @@ -103,3 +105,5 @@ export const BrandSwitcher = (props: BrandSwitcherProps): ReactElement => {
</Paper>
);
};

export default BrandSwitcher;
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,25 @@
* under the License.
*/

import {
Button,
Dialog,
DialogTitle,
DialogContent,
DialogContentText,
DialogActions,
TextField,
extendTheme,
Theme,
Alert,
} from '@oxygen-ui/react';
import {extendTheme, Theme} from '@oxygen-ui/react';
import Alert from '@oxygen-ui/react/Alert';
import Button from '@oxygen-ui/react/Button';
import Dialog from '@oxygen-ui/react/Dialog';
import DialogActions from '@oxygen-ui/react/DialogActions';
import DialogContent from '@oxygen-ui/react/DialogContent';
import DialogContentText from '@oxygen-ui/react/DialogContentText';
import DialogTitle from '@oxygen-ui/react/DialogTitle';
import TextField from '@oxygen-ui/react/TextField';
import {ChangeEvent, FC, ReactElement, useState} from 'react';
import {BrandingActions} from '../branding';
import {BrandingActions} from '../branding/store/branding-reducer';

interface OrganizationSelectionDialogProps {
export interface OrganizationSelectionDialogProps {
onClose: () => void;
onOrganizationConnect: (action: {brand: string | undefined; theme: Theme; type: BrandingActions}) => void;
open: boolean;
}

export const OrganizationSelectionDialog: FC<OrganizationSelectionDialogProps> = (
const OrganizationSelectionDialog: FC<OrganizationSelectionDialogProps> = (
props: OrganizationSelectionDialogProps,
): ReactElement => {
const {open, onClose, onOrganizationConnect} = props;
Expand Down Expand Up @@ -167,3 +164,5 @@ export const OrganizationSelectionDialog: FC<OrganizationSelectionDialogProps> =
</Dialog>
);
};

export default OrganizationSelectionDialog;
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import {Theme, useColorScheme} from '@oxygen-ui/react';
import {ReactElement} from 'react';

export const BuildingIcon = ({theme}: {theme: Theme}): ReactElement => {
const BuildingIcon = ({theme}: {theme: Theme}): ReactElement => {
const {mode} = useColorScheme();

return (
Expand All @@ -37,3 +37,5 @@ export const BuildingIcon = ({theme}: {theme: Theme}): ReactElement => {
</svg>
);
};

export default BuildingIcon;
19 changes: 0 additions & 19 deletions examples/multi-brand-identity/src/components/icons/index.ts

This file was deleted.

21 changes: 0 additions & 21 deletions examples/multi-brand-identity/src/components/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
* under the License.
*/

import {Grid, SignIn, useTheme, useColorScheme, Theme} from '@oxygen-ui/react';
import {useTheme, useColorScheme, Theme} from '@oxygen-ui/react';
import Grid from '@oxygen-ui/react/Grid';
import SignIn from '@oxygen-ui/react/SignIn';
import {ReactElement} from 'react';

export const LoginPage = (): ReactElement => {
const LoginPage = (): ReactElement => {
const theme: Theme = useTheme();
const {mode} = useColorScheme();

Expand All @@ -43,3 +45,5 @@ export const LoginPage = (): ReactElement => {
</Grid>
);
};

export default LoginPage;
19 changes: 0 additions & 19 deletions examples/multi-brand-identity/src/pages/index.ts

This file was deleted.

12 changes: 6 additions & 6 deletions pnpm-lock.yaml

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

8 changes: 4 additions & 4 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@oxygen/primitives": ["packages/primitives/src"],
"@oxygen/logger": ["packages/logger/src/index.ts"],
"@oxygen/react": ["packages/react/src/index.ts"],
"@oxygen/react-icons": ["packages/react-icons/src/index.ts"]
"@oxygen-ui/primitives": ["packages/primitives/src"],
"@oxygen-ui/logger": ["packages/logger/src/index.ts"],
"@oxygen-ui/react": ["packages/react/src/index.ts"],
"@oxygen-ui/react-icons": ["packages/react-icons/src/index.ts"]
}
}
}

0 comments on commit 30304ab

Please sign in to comment.