Skip to content

Commit

Permalink
feat(client):first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
EmbarckleSreerag committed Dec 6, 2022
1 parent 72c69cd commit 282874d
Show file tree
Hide file tree
Showing 14 changed files with 9,619 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
node_modules/
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
43 changes: 39 additions & 4 deletions package-lock.json

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

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"mobx": "^6.6.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
"web-vitals": "^2.1.4",
"yarn": "^1.22.19"
},
"scripts": {
"start": "react-scripts start",
Expand All @@ -34,5 +36,8 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"typescript": "^4.8.3"
}
}
133 changes: 133 additions & 0 deletions src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

*.crt
*.pem
21 changes: 21 additions & 0 deletions src/Screens/Demo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

import React from "react";
import { useStore } from "../stores/Index";

export const Demo:React.FC= ()=>{
const {AuthStore}=useStore();
const handleChange=()=>{
AuthStore.printFunctionDetails();
}
return (
<div>
<div style={{marginLeft:'20px' , marginTop:'50px'}}>
<label>Enter username</label>
<input></input>
<label>passwords</label>
<input></input>
<button onClick={handleChange}>submit</button>
</div>
</div>
);
};
22 changes: 22 additions & 0 deletions src/Screens/report/Report.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

import React from 'react';


export const Report:React.FC= ()=>{

return(
<div className='report'>
<div className='wrapper'>
<div className='column-one'>
<div className='registration'>
<div>Registration Information</div>


</div>

</div>

</div>
</div>
);
}
11 changes: 11 additions & 0 deletions src/Screens/report/report-styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
div.report {
div.wrapper {
div.column-one {
div.registration {
background-color: azure;
color: beige;
margin-bottom: 10px;
}
}
}
}
10 changes: 8 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';

import reportWebVitals from './reportWebVitals';
import {Demo} from '../src/Screens/Demo'
import { StoreProvider } from './stores/Index';

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<App />
{/* <App /> */}
<StoreProvider>
{/* <Report /> */}
<Demo />
</StoreProvider>
</React.StrictMode>
);

Expand Down
20 changes: 20 additions & 0 deletions src/stores/AuthStore.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { makeAutoObservable } from "mobx";

export class AuthStore{
public name : string | null;

public constructor(){
this.name=null
makeAutoObservable(this)
}

public setName(name:string):void{
this.name=name;
}

public async printFunctionDetails(): Promise<void> {

console.log('hi from store')

}
}
15 changes: 15 additions & 0 deletions src/stores/Index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from "react";
import { createContext, ReactNode, useContext } from "react";
import { Rootstore } from "./Rootstore";

const Context = createContext<Rootstore>({} as Rootstore);
const Provider=Context.Provider
interface IProps {
children: ReactNode;
}
export const StoreProvider: React.FC<IProps> = ({ children }) => {
const store = new Rootstore();
return <Provider value={store}>{children}</Provider>
};

export const useStore=()=>useContext(Context)
9 changes: 9 additions & 0 deletions src/stores/Rootstore.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { AuthStore } from "./AuthStore";

export class Rootstore{
public AuthStore:AuthStore

public constructor(){
this.AuthStore=new AuthStore();
}
}
Loading

0 comments on commit 282874d

Please sign in to comment.