Skip to content

Commit

Permalink
Basic CRUD done:v2
Browse files Browse the repository at this point in the history
  • Loading branch information
zin-lin committed Dec 11, 2023
1 parent cf5cb89 commit 1141032
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 11 deletions.
10 changes: 10 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"react-redux": "^8.0.7",
"react-router-dom": "^6.8.2",
"react-scripts": "5.0.1",
"react-spinners": "^0.13.8",
"stream": "^0.0.2",
"stripe": "^14.4.0",
"tunnel2": "^0.0.6",
Expand Down
29 changes: 18 additions & 11 deletions src/views/BookViewPorts/updateBookPC.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import list from "../List";
import FlatList from "flatlist-react/lib";
import Markdown from "react-markdown";
import {saveAs} from 'file-saver';
import {BarLoader} from "react-spinners";

interface Props{
bid : string;
Expand Down Expand Up @@ -42,6 +43,7 @@ const UpdateBookPC: React.FC<Props>= (props:Props)=>{
let [displaySImage, setDisplaySImage] = useState(box)
let [saveMode, setSaveMode] = useState('write')

let [loading, setLoading] = useState(true)
// for nav bar
let [addOpacity, setAddOpacity] = useState(0)
const [addVisibility, setAddVisibility] = useState<Visibility | undefined>('hidden')
Expand Down Expand Up @@ -455,6 +457,7 @@ const UpdateBookPC: React.FC<Props>= (props:Props)=>{
meta.len = details['len']
meta.list = details['attributes']
setMeta(meta!)
setLoading(false)
})
console.log(data)
});
Expand Down Expand Up @@ -582,23 +585,27 @@ const UpdateBookPC: React.FC<Props>= (props:Props)=>{
}}>
<div style={{margin:30, width:'80%'}}>
<p style={{fontSize:30}}>Meta<span style={{color:'#ce4045', fontWeight:'bold'}}>Data</span></p>
<div style={{height:290, overflow:'auto', width:'100%'}}>
{meta !== undefined?
{!loading? <div style={{height: 290, overflow: 'auto', width: '100%'}}>
{meta !== undefined ?
<div>
<div style={{display:'flex'}}>
<div className='circle' style={{background:'white'}}></div><div className='circle' style={{background:'#4eb9b5'}}></div><div className='circle' style={{background:'#9e4eb9'}}></div>
<div style={{display: 'flex'}}>
<div className='circle' style={{background: 'white'}}></div>
<div className='circle' style={{background: '#4eb9b5'}}></div>
<div className='circle' style={{background: '#9e4eb9'}}></div>
</div>
<p style={{color:'#ddd'}}> The Attributes</p>
<div style={{display:'flex', flexWrap:'wrap', order:'2'}}>
{meta.list.map(att =>{
return <div className='highlight-dark' style={{margin:6, color:'#aaa'}}>{att}</div>
<p style={{color: '#ddd'}}> The Attributes</p>
<div style={{display: 'flex', flexWrap: 'wrap', order: '2'}}>
{meta.list.map(att => {
return <div className='highlight-dark'
style={{margin: 6, color: '#aaa'}}>{att}</div>
})}
</div>

<p style={{color:'#ddd'}}><span style={{fontWeight:'bold'}}>Number of rows:</span> <span style={{color:'#ea37b1'}}>{meta.len}</span></p>
<p style={{color: '#ddd'}}><span style={{fontWeight: 'bold'}}>Number of rows:</span>
<span style={{color: '#ea37b1'}}>{meta.len}</span></p>
</div>
:<div></div>}
</div>
: <div></div>}
</div>: <BarLoader loading={true} cssOverride={{width:'100%'}} color={'#ef2fb8'}/>}
</div>
</div>
</div>
Expand Down

0 comments on commit 1141032

Please sign in to comment.