Files
PyUIBuilder/src/components/header.js

64 lines
2.5 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"
import { CrownFilled, DownloadOutlined, DownOutlined } from "@ant-design/icons"
2024-09-26 11:59:24 +05:30
import FrameWorks from "../constants/frameworks"
import Premium from "../sidebar/utils/premium"
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 (
<div className={`tw-w-full tw-bg-primaryBg 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
<Select
2024-09-26 11:59:24 +05:30
// defaultValue={framework}
value={framework}
2024-09-08 21:58:53 +05:30
options={items}
2024-09-26 11:59:24 +05:30
// onSelect={(key) => {console.log("value: ", key); onFrameworkChange(key); }}
onChange={(key) => {onFrameworkChange(key)}}
2024-09-08 21:58:53 +05:30
className="tw-min-w-[150px]"
/>
2024-09-13 19:24:03 +05:30
<div className="tw-ml-auto tw-flex tw-gap-2 tw-place-content-center">
2025-03-11 20:18:52 +05:30
<button data-tally-open="mVDY7N" data-tally-layout="modal" data-tally-emoji-text="👋"
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">
Join Waitlist
</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