-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa17b4f
commit 9a9c164
Showing
7 changed files
with
482 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
import { Dock } from '../../../lib/dock/Dock'; | ||
import { DocSectionCode } from '../../common/docsectioncode'; | ||
import { DocSectionText } from '../../common/docsectiontext'; | ||
|
||
export function PTDoc(props) { | ||
const items = [ | ||
{ | ||
label: 'Finder', | ||
icon: () => <img alt="Finder" src="https://primefaces.org/cdn/primereact/images/dock/finder.svg" width="100%" /> | ||
}, | ||
{ | ||
label: 'App Store', | ||
icon: () => <img alt="App Store" src="https://primefaces.org/cdn/primereact/images/dock/appstore.svg" width="100%" /> | ||
}, | ||
{ | ||
label: 'Photos', | ||
icon: () => <img alt="Photos" src="https://primefaces.org/cdn/primereact/images/dock/photos.svg" width="100%" /> | ||
}, | ||
{ | ||
label: 'Trash', | ||
icon: () => <img alt="trash" src="https://primefaces.org/cdn/primereact/images/dock/trash.png" width="100%" /> | ||
} | ||
]; | ||
|
||
const positions = [ | ||
{ | ||
label: 'Bottom', | ||
value: 'bottom' | ||
}, | ||
{ | ||
label: 'Top', | ||
value: 'top' | ||
}, | ||
{ | ||
label: 'Left', | ||
value: 'left' | ||
}, | ||
{ | ||
label: 'Right', | ||
value: 'right' | ||
} | ||
]; | ||
|
||
const code = { | ||
basic: ` | ||
<Dock | ||
model={items} | ||
position={"bottom"} | ||
pt={{ | ||
container: { | ||
style: { background: 'linear-gradient(to right,#056BAE, #673976, #056BAE)', borderRadius: '12px' } | ||
} | ||
}} | ||
/> | ||
`, | ||
javascript: ` | ||
import React from 'react'; | ||
import { Dock } from 'primereact/dock'; | ||
import './DockDemo.css'; | ||
export default function PTDemo() { | ||
const items = [ | ||
{ | ||
label: 'Finder', | ||
icon: () => <img alt="Finder" src="https://primefaces.org/cdn/primereact/images/dock/finder.svg" width="100%" />, | ||
}, | ||
{ | ||
label: 'App Store', | ||
icon: () => <img alt="App Store" src="https://primefaces.org/cdn/primereact/images/dock/appstore.svg" width="100%" />, | ||
}, | ||
{ | ||
label: 'Photos', | ||
icon: () => <img alt="Photos" src="https://primefaces.org/cdn/primereact/images/dock/photos.svg" width="100%" />, | ||
}, | ||
{ | ||
label: 'Trash', | ||
icon: () => <img alt="trash" src="https://primefaces.org/cdn/primereact/images/dock/trash.png" width="100%" />, | ||
} | ||
]; | ||
return ( | ||
<div className="card dock-demo"> | ||
<div className="dock-window" style={{ backgroundImage: 'url(/images/dock/window.jpg)' }}> | ||
<Dock | ||
model={items} | ||
position={"bottom"} | ||
pt={{ | ||
container: { | ||
style: { background: 'linear-gradient(to right,#056BAE, #673976, #056BAE)', borderRadius: '12px' } | ||
} | ||
}} | ||
/> | ||
</div> | ||
</div> | ||
) | ||
} | ||
`, | ||
typescript: ` | ||
import React from 'react'; | ||
import { Dock } from 'primereact/dock'; | ||
import { MenuItem } from 'primereact/menuitem'; | ||
import './DockDemo.css'; | ||
export default function PTDemo() { | ||
const items: MenuItem[] = [ | ||
{ | ||
label: 'Finder', | ||
icon: () => <img alt="Finder" src="https://primefaces.org/cdn/primereact/images/dock/finder.svg" width="100%" />, | ||
}, | ||
{ | ||
label: 'App Store', | ||
icon: () => <img alt="App Store" src="https://primefaces.org/cdn/primereact/images/dock/appstore.svg" width="100%" />, | ||
}, | ||
{ | ||
label: 'Photos', | ||
icon: () => <img alt="Photos" src="https://primefaces.org/cdn/primereact/images/dock/photos.svg" width="100%" />, | ||
}, | ||
{ | ||
label: 'Trash', | ||
icon: () => <img alt="trash" src="https://primefaces.org/cdn/primereact/images/dock/trash.png" width="100%" />, | ||
} | ||
]; | ||
return ( | ||
<div className="card dock-demo"> | ||
<div className="dock-window" style={{ backgroundImage: 'url(/images/dock/window.jpg)' }}> | ||
<Dock | ||
model={items} | ||
position={"bottom"} | ||
pt={{ | ||
container: { | ||
style: { background: 'linear-gradient(to right,#056BAE, #673976, #056BAE)', borderRadius: '12px' } | ||
} | ||
}} | ||
/> | ||
</div> | ||
</div> | ||
) | ||
} | ||
`, | ||
extFiles: { | ||
'DockDemo.css': ` | ||
/* DockDemo.css */ | ||
.dock-demo .dock-window { | ||
width: 100%; | ||
height: 450px; | ||
position: relative; | ||
background-image: url('https://primefaces.org/cdn/primereact/images/dock/window.jpg'); | ||
background-repeat: no-repeat; | ||
background-size: cover; | ||
} | ||
.dock-demo .p-dock { | ||
z-index: 1000; | ||
} | ||
` | ||
} | ||
}; | ||
|
||
return ( | ||
<> | ||
<DocSectionText {...props}> | ||
<p> | ||
Menu requires a collection of menuitems as its <i>model</i>. Default location is <i>bottom</i> and other sides are also available when defined with the <i>position</i> property. | ||
</p> | ||
</DocSectionText> | ||
<div className="card"> | ||
<div className="dock-window" style={{ backgroundImage: 'url(/images/dock/window.jpg)' }}> | ||
<Dock | ||
model={items} | ||
position={"bottom"} | ||
pt={{ | ||
container: { | ||
style: { background: 'linear-gradient(to right,#056BAE, #673976, #056BAE)', borderRadius: '12px' } | ||
} | ||
}} | ||
/> | ||
</div> | ||
</div> | ||
<DocSectionCode code={code} /> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
import React from 'react'; | ||
import { DocSectionText } from '../../common/docsectiontext'; | ||
|
||
export const Wireframe = (props) => { | ||
|
||
return ( | ||
<> | ||
<DocSectionText {...props} /> | ||
<div> | ||
<img className="w-full" src="https://primefaces.org/cdn/primereact/images/pt/wireframe-placeholder.jpg" alt="dock" /> | ||
</div> | ||
</> | ||
); | ||
}; |
Oops, something went wrong.