twenty/front/src/App.tsx

72 lines
11 KiB
TypeScript
Raw Normal View History

import React from 'react';
2023-04-09 17:43:43 +03:00
import People from './pages/people/People';
import Companies from './pages/companies/Companies';
2023-04-20 19:46:27 +03:00
import AuthCallback from './pages/auth/Callback';
import Login from './pages/auth/Login';
import AppLayout from './layout/AppLayout';
2023-04-09 17:43:43 +03:00
import { Routes, Route, Navigate } from 'react-router-dom';
2023-04-21 16:36:10 +03:00
import RequireAuth from './components/auth/RequireAuth';
import Opportunities from './pages/opportunities/Opportunities';
2022-12-01 17:58:08 +03:00
function App() {
const user = {
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6b',
email: 'charles@twenty.com',
first_name: 'Charles',
last_name: 'Bochet',
};
2023-01-27 14:12:04 +03:00
2023-04-09 17:43:43 +03:00
const workspace = {
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6b',
2023-04-09 17:43:43 +03:00
name: 'Claap',
logo: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAJ82lDQ1BJQ0MgUHJvZmlsZQAASImFlnk8lWkbx+/nOfuG43DsHPuWfTvIvm/Z11SOY986Tra0SypMSpJQosZaNJUlI0mKygiFFjVkhDKNFqlU5jnMTE3v+3nf63yuz/X9XM99/851388fzw8AUgCLw4mDBQCIT0jiejlYMwICgxi4KYACkoAKmIDKYm/iWHl4uAIk/q7/jnfDAOLVuxo8rf98/j+DGha+iQ0A5IEwk83hJiG8D2Gf1CQOj0cRFuIiQyE8x+PIZYbRPA5dYdHlNT5eNgivAgBPZrG4kQAQmUifkcKORHSIAQhrJ4RFJyDM0zePiEtOQ7iH14+P3xiG8HuEVZD1HABIDN48od9oRv5LP/QffRYr8h+Oj0tm/3Uu3o2QwxN8vZEqjqQkiACaIA4kgzTAABzABRuRTjTSCUfu/r/vYy7vs0FWcsBmZEc0iARRIAnZb/+NlveyUhJIBSxkTTjScUV+Nrz3uCL5hr6sCtFvfe1lvAXALGxpaanta89VAY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h0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZXhpZj0iaHR0cDovL25zLmFkb2JlLmNvbS9leGlmLz
};
2022-12-01 17:58:08 +03:00
return (
<div>
{
2023-04-09 17:43:43 +03:00
<AppLayout user={user} workspace={workspace}>
<Routes>
2023-04-21 16:36:10 +03:00
<Route
path="/"
element={
<RequireAuth>
<Navigate to="/people" replace />
</RequireAuth>
}
/>
<Route
path="/people"
element={
<RequireAuth>
<People />
</RequireAuth>
}
/>
<Route
path="/companies"
element={
<RequireAuth>
<Companies />
</RequireAuth>
}
/>
<Route
path="/opportunities"
element={
<RequireAuth>
<Opportunities />
</RequireAuth>
}
/>
2023-04-20 19:46:27 +03:00
<Route path="/auth/callback" element={<AuthCallback />} />
<Route path="/auth/login" element={<Login />} />
</Routes>
</AppLayout>
}
</div>
2022-12-01 17:58:08 +03:00
);
}
export default App;