Skip to content

Commit

Permalink
Replace demo by AdminGuesser
Browse files Browse the repository at this point in the history
  • Loading branch information
fzaninotto committed Nov 5, 2024
1 parent 765855c commit d9ab7e7
Show file tree
Hide file tree
Showing 60 changed files with 87 additions and 4,222 deletions.
2 changes: 1 addition & 1 deletion packages/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<meta name="theme-color" content="#000000" />
<link rel="manifest" href="./manifest.json" />
<link rel="shortcut icon" href="./favicon.ico" />
<title>Atomic CRM</title>
<title>CRM Demo</title>
<style>
body {
margin: 0;
Expand Down
5 changes: 0 additions & 5 deletions packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
"version": "3.2.1",
"private": true,
"dependencies": {
"@hello-pangea/dnd": "^16.3.0",
"@mui/icons-material": "^5.0.1",
"@mui/material": "^5.15.20",
"@nivo/bar": "^0.80.0",
"@nivo/core": "^0.80.0",
"@tanstack/react-query": "^5.45.1",
"@vitejs/plugin-react": "^2.2.0",
"clsx": "^1.1.1",
Expand All @@ -19,7 +16,6 @@
"ra-supabase": "^3.2.1",
"react": "^18.2.0",
"react-admin": "^5.0.0",
"react-beautiful-dnd": "^13.0.0",
"react-dom": "^18.2.0",
"react-error-boundary": "^3.1.4",
"react-router": "^6.23.1",
Expand All @@ -34,7 +30,6 @@
"@types/jest": "^26.0.19",
"@types/lodash": "~4.14.168",
"@types/react": "^18.0.0",
"@types/react-beautiful-dnd": "^13.0.0",
"@types/react-dom": "^18.0.0",
"source-map-explorer": "^2.0.0",
"tsx": "^3.12.2",
Expand Down
58 changes: 6 additions & 52 deletions packages/demo/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,77 +1,31 @@
import * as React from 'react';
import {
Admin,
Resource,
ListGuesser,
defaultTheme,
mergeTranslations,
CustomRoutes,
} from 'react-admin';
import { mergeTranslations } from 'react-admin';
import polyglotI18nProvider from 'ra-i18n-polyglot';
import englishMessages from 'ra-language-english';
import { BrowserRouter, Route } from 'react-router-dom';
import { BrowserRouter } from 'react-router-dom';
import {
AdminGuesser,
LoginPage,
raSupabaseEnglishMessages,
SetPasswordPage,
ForgotPasswordPage,
} from 'ra-supabase';
import { QueryClient } from '@tanstack/react-query';
import { authProvider } from './authProvider';
import Layout from './Layout';
import contacts from './contacts';
import companies from './companies';
import deals from './deals';
import { Dashboard } from './dashboard/Dashboard';
import { dataProvider } from './dataProvider';

const queryClient = new QueryClient();
const i18nProvider = polyglotI18nProvider(() => {
return mergeTranslations(englishMessages, raSupabaseEnglishMessages);
}, 'en');

const App = () => (
<BrowserRouter>
<Admin
<AdminGuesser
dataProvider={dataProvider}
authProvider={authProvider}
i18nProvider={i18nProvider}
layout={Layout}
dashboard={Dashboard}
loginPage={LoginPage}
queryClient={queryClient}
theme={{
...defaultTheme,
palette: {
background: {
default: '#fafafb',
},
},
}}
>
<CustomRoutes noLayout>
<Route
path={SetPasswordPage.path}
element={<SetPasswordPage />}
/>
<Route
path={ForgotPasswordPage.path}
element={<ForgotPasswordPage />}
/>
</CustomRoutes>
<Resource name="deals" {...deals} />
<Resource name="contacts" {...contacts} />
<Resource name="companies" {...companies} />
<Resource name="tasks" list={ListGuesser} />
<Resource
name="sales"
list={ListGuesser}
recordRepresentation={(record: any) =>
`${record.first_name} ${record.last_name}`
}
/>
<Resource name="tags" list={ListGuesser} />
</Admin>
title="CRM Demo"
/>
</BrowserRouter>
);

Expand Down
82 changes: 0 additions & 82 deletions packages/demo/src/Header.tsx

This file was deleted.

29 changes: 0 additions & 29 deletions packages/demo/src/Layout.tsx

This file was deleted.

106 changes: 0 additions & 106 deletions packages/demo/src/companies/CompanyAside.tsx

This file was deleted.

25 changes: 0 additions & 25 deletions packages/demo/src/companies/CompanyAvatar.tsx

This file was deleted.

Loading

0 comments on commit d9ab7e7

Please sign in to comment.