Skip to content

Commit

Permalink
if no positions, hide button
Browse files Browse the repository at this point in the history
Volunteer with Project
  • Loading branch information
qchiujunhao committed Sep 4, 2023
1 parent 1f23016 commit e0baf17
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions common/components/common/projects/ProjectVolunteerButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type LeaveProjectParams = {|
type Props = {|
project: ?ProjectDetailsAPIData,
positionToJoin: ?PositionInfo,
positions: $ReadOnlyArray<PositionInfo>,
onVolunteerClick: () => void,
|};
type State = {|
Expand Down Expand Up @@ -163,7 +164,7 @@ class ProjectVolunteerButton extends React.PureComponent<Props, State> {
</Button>);

} else {
if (!_.isEmpty(this.props.positions)) {
if (!_.isEmpty(this.state.project.project_positions)) {
return (
<Button
variant="primary"
Expand All @@ -176,7 +177,9 @@ class ProjectVolunteerButton extends React.PureComponent<Props, State> {
Volunteer With Project
</Button>
);

}
else{
return null
}
}
}
Expand Down

0 comments on commit e0baf17

Please sign in to comment.