* change(ui) - player - back button spacing * change(ui) - onboarding - changes * change(ui) - onboarding - changes * change(ui) - integrations gap-4 * change(ui) - install script copy button styles * change(ui) - copy button in account settings * fix(ui) - error details modal loader position * change(ui) - share popup styles * change(ui) - player improvements * change(ui) - player improvements - playback speed with menu * change(ui) - player improvements - current timezone * change(ui) - player improvements - autoplay options
35 lines
937 B
JavaScript
35 lines
937 B
JavaScript
import React from 'react';
|
|
import { connect } from 'react-redux';
|
|
import NewSiteForm from '../../../Client/Sites/NewSiteForm';
|
|
import { init } from 'Duck/site';
|
|
import { useModal } from 'App/components/Modal';
|
|
|
|
const ProjectFormButton = ({ sites, siteId, init }) => {
|
|
const site = sites.find(({ id }) => id === siteId);
|
|
const { showModal, hideModal } = useModal();
|
|
const openModal = (e) => {
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
init(site);
|
|
showModal(<NewSiteForm onClose={hideModal} />, { right: true });
|
|
};
|
|
|
|
return (
|
|
<>
|
|
<span
|
|
className="text-2xl font-bold ml-2 color-teal underline decoration-dotted cursor-pointer"
|
|
onClick={(e) => openModal(e)}
|
|
>
|
|
{site && site.name}
|
|
</span>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default connect(
|
|
(state) => ({
|
|
siteId: state.getIn(['site', 'siteId']),
|
|
sites: state.getIn(['site', 'list']),
|
|
}),
|
|
{ init }
|
|
)(ProjectFormButton);
|