mirror of
				https://github.com/phuoc-ng/csslayout.git
				synced 2025-10-29 04:16:23 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			197 lines
		
	
	
		
			7.7 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			197 lines
		
	
	
		
			7.7 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import React from 'react';
 | |
| 
 | |
| import './menu.css';
 | |
| 
 | |
| import RelatedPatterns from '../../components/RelatedPatterns';
 | |
| import Pattern from '../../constants/Pattern';
 | |
| import DetailsLayout from '../../layouts/DetailsLayout';
 | |
| import BrowserFrame from '../../placeholders/BrowserFrame';
 | |
| import Circle from '../../placeholders/Circle';
 | |
| import Rectangle from '../../placeholders/Rectangle';
 | |
| 
 | |
| const Details: React.FC<{}> = () => {
 | |
|     return (
 | |
|         <DetailsLayout title="Menu">
 | |
|             <div style={{ padding: '64px 32px' }}>
 | |
|                 <BrowserFrame
 | |
|                     content={(
 | |
|                         <div
 | |
|                             style={{
 | |
|                                 alignItems: 'center',
 | |
|                                 display: 'flex',
 | |
|                                 flexDirection: 'column',
 | |
|                                 height: '100%',
 | |
|                                 justifyContent: 'center',
 | |
|                                 padding: '8px',
 | |
|                             }}
 | |
|                         >
 | |
|                             <div
 | |
|                                 style={{
 | |
|                                     border: '1px solid rgba(0, 0, 0, 0.3)',
 | |
|                                     borderRadius: '4px',
 | |
|                                     width: '40%',
 | |
|                                 }}
 | |
|                             >
 | |
|                                 <div
 | |
|                                     className="p-menu-item"
 | |
|                                     style={{
 | |
|                                         alignItems: 'center',
 | |
|                                         display: 'flex',
 | |
|                                         height: '32px',
 | |
|                                         padding: '0 8px',
 | |
|                                     }}
 | |
|                                 >
 | |
|                                     <div style={{ width: '40%' }}><Rectangle /></div>
 | |
|                                 </div>
 | |
|                                 <div
 | |
|                                     className="p-menu-item"
 | |
|                                     style={{
 | |
|                                         alignItems: 'center',
 | |
|                                         display: 'flex',
 | |
|                                         height: '32px',
 | |
|                                         padding: '0 8px',
 | |
|                                     }}
 | |
|                                 >
 | |
|                                     <Circle />
 | |
|                                     <div style={{ marginLeft: '4px', width: '50%' }}><Rectangle /></div>
 | |
|                                 </div>
 | |
|                                 <div
 | |
|                                     className="p-menu-item"
 | |
|                                     style={{
 | |
|                                         alignItems: 'center',
 | |
|                                         display: 'flex',
 | |
|                                         height: '32px',
 | |
|                                         justifyContent: 'space-between',
 | |
|                                         padding: '0 8px',
 | |
|                                     }}
 | |
|                                 >
 | |
|                                     <div style={{ width: '30%' }}><Rectangle /></div>
 | |
|                                     <div>Ctrl + X</div>
 | |
|                                 </div>
 | |
|                                 <div
 | |
|                                     className="p-menu-item"
 | |
|                                     style={{
 | |
|                                         alignItems: 'center',
 | |
|                                         display: 'flex',
 | |
|                                         height: '32px',
 | |
|                                         justifyContent: 'space-between',
 | |
|                                         padding: '0 8px',
 | |
|                                     }}
 | |
|                                 >
 | |
|                                     <div style={{ width: '70%' }}><Rectangle /></div>
 | |
|                                     <div>Ctrl + C</div>
 | |
|                                 </div>
 | |
|                                 <div
 | |
|                                     className="p-menu-item"
 | |
|                                     style={{
 | |
|                                         alignItems: 'center',
 | |
|                                         display: 'flex',
 | |
|                                         height: '32px',
 | |
|                                         justifyContent: 'space-between',
 | |
|                                         padding: '0 8px',
 | |
|                                     }}
 | |
|                                 >
 | |
|                                     <div style={{ width: '20%' }}><Rectangle /></div>
 | |
|                                     <Circle />
 | |
|                                 </div>
 | |
|                                 <div
 | |
|                                     className="p-menu-item"
 | |
|                                     style={{
 | |
|                                         alignItems: 'center',
 | |
|                                         display: 'flex',
 | |
|                                         height: '32px',
 | |
|                                         justifyContent: 'space-between',
 | |
|                                         padding: '0 8px',
 | |
|                                     }}
 | |
|                                 >
 | |
|                                     <div style={{ alignItems: 'center', display: 'flex', width: '80%' }}>
 | |
|                                         <Circle />
 | |
|                                         <div style={{ marginLeft: '4px', width: '50%' }}><Rectangle /></div>
 | |
|                                     </div>
 | |
|                                     <Circle />
 | |
|                                 </div>
 | |
|                                 <div style={{ borderBottom: '1px solid rgba(0, 0, 0, 0.3)', height: '1px' }} />
 | |
|                                 <div
 | |
|                                     className="p-menu-item"
 | |
|                                     style={{
 | |
|                                         alignItems: 'center',
 | |
|                                         display: 'flex',
 | |
|                                         height: '32px',
 | |
|                                         justifyContent: 'space-between',
 | |
|                                         padding: '0 8px',
 | |
|                                     }}
 | |
|                                 >
 | |
|                                     <div style={{ width: '40%' }}><Rectangle /></div>
 | |
|                                     <div>Ctrl + V</div>
 | |
|                                 </div>
 | |
|                             </div>
 | |
|                         </div>
 | |
|                     )}
 | |
|                     source={`
 | |
| <div style="
 | |
|     display: flex;
 | |
|     flex-direction: column;
 | |
| 
 | |
|     /* Border */
 | |
|     border: 1px solid rgba(0, 0, 0, 0.3);
 | |
|     border-radius: 4px;
 | |
| ">
 | |
|     <!-- Normal menu item -->
 | |
|     <div style="
 | |
|         /* Center the content horizontally */
 | |
|         align-items: center;
 | |
|         display: flex;
 | |
|     ">
 | |
|         ...
 | |
|     </div>
 | |
| 
 | |
|     <!-- With hot key -->
 | |
|     <div style="
 | |
|         align-items: center;
 | |
|         display: flex;
 | |
|         /* Push the hot key to the right */
 | |
|         justify-content: space-between;
 | |
|     ">
 | |
|         <!-- Label -->
 | |
|         ...
 | |
|         <!-- Hot key -->
 | |
|         ...
 | |
|     </div>
 | |
| 
 | |
|     <!-- With image and hot key -->
 | |
|     <div style="
 | |
|         align-items: center;
 | |
|         display: flex;
 | |
|         /* Push the hot key to the right */
 | |
|         justify-content: space-between;
 | |
|     ">
 | |
|         <div style="
 | |
|             align-items: center;
 | |
|             display: flex;
 | |
|         ">
 | |
|             <!-- Image -->
 | |
|             ...
 | |
|             <!-- Label -->
 | |
|             ...
 | |
|         </div>
 | |
| 
 | |
|         <!-- Hot key -->
 | |
|         ...
 | |
|     </div>
 | |
| 
 | |
|     <!-- Divider -->
 | |
|     <div style="
 | |
|         border-bottom: 1px solid rgba(0, 0, 0, 0.3);
 | |
|         height: 1px;
 | |
|     " />
 | |
| </div>
 | |
| `}
 | |
|                 />
 | |
|             </div>
 | |
|             <RelatedPatterns patterns={[Pattern.DotLeader, Pattern.PropertyList, Pattern.SplitNavigation]} />
 | |
|         </DetailsLayout>
 | |
|     );
 | |
| };
 | |
| 
 | |
| export default Details;
 |