Files
PyUIBuilder/src/components/header.js

75 lines
3.3 KiB
JavaScript
Raw Normal View History

2024-09-26 11:59:24 +05:30
import { useEffect, useState } from "react"
2024-09-08 21:58:53 +05:30
2024-09-13 19:24:03 +05:30
import { Select, Input, Button } from "antd"
2025-03-14 11:21:08 +05:30
import { CrownFilled, DownloadOutlined, DownOutlined, PlayCircleFilled, VideoCameraOutlined } from "@ant-design/icons"
2024-09-26 11:59:24 +05:30
import FrameWorks from "../constants/frameworks"
import Premium from "../sidebar/utils/premium"
2025-03-14 11:21:08 +05:30
import VideoPopUp from "./video-popup"
2024-09-26 11:59:24 +05:30
2024-09-08 21:58:53 +05:30
const items = [
{
2024-09-26 11:59:24 +05:30
value: FrameWorks.TKINTER,
2024-09-08 21:58:53 +05:30
label: 'tkinter',
},
{
2024-09-26 11:59:24 +05:30
value: FrameWorks.CUSTOMTK,
2024-09-08 21:58:53 +05:30
label: 'customtk',
},
]
2024-09-26 11:59:24 +05:30
function Header({projectName, onProjectNameChange, framework, onFrameworkChange,
onExportClick, className=''}){
2024-09-08 21:58:53 +05:30
return (
2025-03-16 10:01:35 +05:30
<div className={`tw-w-full tw-bg-primaryBg tw-gap-2 tw-overflow-x-auto tw-p-2 tw-flex tw-place-items-center
2024-09-26 11:59:24 +05:30
${className||''}`}>
2024-09-08 21:58:53 +05:30
2025-03-14 11:21:08 +05:30
<div className="tw-flex tw-gap-2 tw-place-content-center">
<Select
// defaultValue={framework}
value={framework}
options={items}
// onSelect={(key) => {console.log("value: ", key); onFrameworkChange(key); }}
onChange={(key) => {onFrameworkChange(key)}}
className="tw-min-w-[150px]"
/>
<VideoPopUp>
<div className="tw-p-1 tw-w-full tw-outline-none tw-bg-transparent tw-border-[1px]
tw-border-gray-400 tw-rounded-md tw-no-underline tw-border-solid hover:tw-bg-[#9333EA]
hover:tw-text-white tw-duration-200 tw-flex tw-gap-1
tw-text-black tw-text-center tw-px-4 tw-text-sm tw-cursor-pointer">
Watch demo
<PlayCircleFilled className="tw-text-lg"/>
</div>
</VideoPopUp>
</div>
2024-09-13 19:24:03 +05:30
<div className="tw-ml-auto tw-flex tw-gap-2 tw-place-content-center">
2025-03-14 11:21:08 +05:30
<button data-tally-open="mVDY7N" data-tally-layout="modal" data-tally-emoji-text="👋"
2025-03-11 20:18:52 +05:30
data-tally-emoji-animation="wave" className="tw-p-1 tw-w-full tw-outline-none tw-bg-transparent tw-border-[1px]
tw-border-gray-400 tw-rounded-md tw-no-underline tw-border-solid hover:tw-bg-[#9333EA]
hover:tw-text-white tw-duration-200
tw-text-black tw-text-center tw-px-4 tw-text-sm tw-cursor-pointer">
2025-03-18 18:08:25 +05:30
Get Updates
2025-03-14 11:21:08 +05:30
</button>
<Premium className="tw-text-2xl tw-bg-purple-600 tw-text-center
tw-w-[40px] tw-min-w-[40px] tw-h-[35px] tw-rounded-md
tw-cursor-pointer tw-text-white
tw-transition-all
hover:tw-scale-[1.2]">
<CrownFilled />
</Premium>
2024-09-26 11:59:24 +05:30
<Input value={projectName} onChange={(e) => onProjectNameChange(e.target.value)} placeholder="project name"/>
<Button icon={<DownloadOutlined />} onClick={onExportClick}>
2024-09-13 19:24:03 +05:30
Export code
</Button>
2024-09-08 21:58:53 +05:30
</div>
</div>
)
}
export default Header