Skip to content

Commit

Permalink
Add Phase Planner view and navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
saithsab877 committed Nov 21, 2024
1 parent c44c6d3 commit 61769c3
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 13 deletions.
4 changes: 4 additions & 0 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import WorkspaceFeature from 'people/widgetViews/WorkspaceFeature';
import PeopleHeader from '../people/main/Header';
import TokenRefresh from '../people/utils/TokenRefresh';
import GenerateStoriesView from '../people/widgetViews/GenerateStoriesView';
import PhasePlannerView from '../people/widgetViews/PhasePlannerView';
import BotsBody from './bots/Body';
import Body from './tribes/Body';
import Header from './tribes/Header';
Expand Down Expand Up @@ -50,6 +51,9 @@ const modeDispatchPages: Record<AppMode, () => React.ReactElement> = {
<Route path="/workspace/:uuid">
<WorkspaceMission />
</Route>
<Route path="/feature/:feature_uuid/phase/:phase_uuid/planner">
<PhasePlannerView />
</Route>
<Route path="/feature/:feature_uuid/stories">
<GenerateStoriesView />
</Route>
Expand Down
29 changes: 29 additions & 0 deletions src/people/widgetViews/PhasePlannerView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';
import { useParams } from 'react-router-dom';
import styled from 'styled-components';

const Container = styled.div`
padding: 20px;
background: white;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
`;

interface PhasePlannerParams {
feature_uuid: string;
phase_uuid: string;
}

const PhasePlannerView: React.FC = () => {
const { feature_uuid, phase_uuid } = useParams<PhasePlannerParams>();

return (
<Container>
<h1>Phase Planner</h1>
<p>Feature UUID: {feature_uuid}</p>
<p>Phase UUID: {phase_uuid}</p>
</Container>
);
};

export default PhasePlannerView;
44 changes: 31 additions & 13 deletions src/people/widgetViews/workspace/WorkspacePhase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,13 @@ const WorkspacePhasingTabs = (props: WorkspacePhaseProps) => {
history.push(`/feature/${props.workspace_uuid}`);
};

const handlePhasePlannerClick = () => {
if (phases[selectedIndex]) {
const phase = phases[selectedIndex];
history.push(`/feature/${phase.feature_uuid}/phase/${phase.uuid}/planner`);
}
};

const handlePhaseNameChange = (name: string) => setPhaseName(name);

const createOrUpdateFeaturePhase = async (op: PhaseOperationType) => {
Expand Down Expand Up @@ -297,19 +304,30 @@ const WorkspacePhasingTabs = (props: WorkspacePhaseProps) => {
<TabContent>
<PostABounty>
{canPostBounty && (
<Button
onClick={handlePostBountyClick}
style={{
backgroundColor: '#49C998',
borderRadius: '6px',
gap: '10px'
}}
>
<div>
<img src={addBounty} alt="" />
Post a Bounty
</div>
</Button>
<>
<Button
onClick={handlePhasePlannerClick}
style={{
backgroundColor: '#49C998',
borderRadius: '6px',
padding: '15px 20px'
}}
>
<div>Phase Planner</div>
</Button>
<Button
onClick={handlePostBountyClick}
style={{
backgroundColor: '#49C998',
borderRadius: '6px'
}}
>
<div>
<img src={addBounty} alt="" />
Post a Bounty
</div>
</Button>
</>
)}
</PostABounty>
<DisplayBounties>
Expand Down
20 changes: 20 additions & 0 deletions src/people/widgetViews/workspace/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,26 @@ export const PostABounty = styled.div`
gap: 10px;
margin-top: 0.5rem;
margin-left: auto;
display: flex;
align-items: center;
justify-content: flex-end;
direction: row;
button {
div {
display: flex;
align-items: center;
gap: 8px;
}
img {
vertical-align: middle;
}
}
button:first-child {
margin-right: 10px;
}
`;

export const DisplayBounties = styled.div`
Expand Down

0 comments on commit 61769c3

Please sign in to comment.