Skip to content

Commit

Permalink
DN-4: Demos page.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereckmezquita committed Jul 15, 2024
1 parent f5a7476 commit ef89f54
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 642 deletions.
15 changes: 0 additions & 15 deletions client/src/app/test/api/AuthDemo.tsx

This file was deleted.

227 changes: 0 additions & 227 deletions client/src/app/test/api/CommentDemo.tsx

This file was deleted.

17 changes: 17 additions & 0 deletions client/src/app/test/api/demos/AuthDemo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use client';
import React, { useState } from 'react';
import { useAuth } from '@components/context/AuthContext';
import { BoxContainer } from '../modules/BoxContainer';
import { AuthViews } from '@components/components/ui/modal/auth/AuthViews/AuthViews';

export function AuthDemo() {
const [title, setTitle] = useState('Login');
const { user, login, logout } = useAuth();

return (
<BoxContainer>
<h2 style={{ paddingBottom: '5px' }}>{title}</h2>
<AuthViews onTitleChange={setTitle} />
</BoxContainer>
);
}
28 changes: 28 additions & 0 deletions client/src/app/test/api/modules/BoxContainer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from 'react';
import styled from 'styled-components';

const Box = styled.div`
margin: 10px;
padding: 20px;
text-decoration: none;
color: inherit;
padding: 5px;
text-decoration: none;
border: 1px solid #ccc;
border-radius: 5px;
text-align: center;
&:hover {
border-color: #aaa;
}
`;

export function BoxContainer({ children }: { children: React.ReactNode }) {
return (
<Box style={{ width: '50%', margin: 'auto' }}>
<div style={{ padding: '20px' }}>{children}</div>
</Box>
);
}
Loading

0 comments on commit ef89f54

Please sign in to comment.