Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a Link section which displays Links Stats #15

Open
wants to merge 1 commit into
base: monorepo
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion yaus/apps/admin/src/app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useState, useEffect } from 'react';
import Dashboard from './components/Dashboard';

import { createBrowserHistory as createHistory } from 'history';
import Links from './components/Dashboard/Links';
const history = createHistory();

const createApolloClient = async () => {
Expand Down Expand Up @@ -41,7 +42,7 @@ const App = () => {
dashboard={Dashboard}
history={history}
>
<Resource name="link" list={ListGuesser} />
<Resource name="link" list={Links} />
</Admin>
)
};
Expand Down
4 changes: 3 additions & 1 deletion yaus/apps/admin/src/app/components/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const Dashboard = () => {return <></>};
const Dashboard = () => {
return <>"Welcome to Dashboard"</>;
};

export default Dashboard;
21 changes: 21 additions & 0 deletions yaus/apps/admin/src/app/components/Dashboard/Links/Links.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// in src/posts.js
import {
List,
Datagrid,
TextField,
DateField,
BooleanField,
NumberField,
} from 'react-admin';

const Links = () => (
<List>
<Datagrid>
<NumberField source="hashid" />
<TextField source="customHashId" />
<TextField source="clicks" />
</Datagrid>
</List>
);

export default Links;
3 changes: 3 additions & 0 deletions yaus/apps/admin/src/app/components/Dashboard/Links/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Links from './Links';

export default Links;
20 changes: 0 additions & 20 deletions yaus/apps/admin/src/app/posts.tsx

This file was deleted.