Quellcode durchsuchen

change color in group

reiji-h vor 2 Jahren
Ursprung
Commit
e994fa2dd0

+ 6 - 4
apps/app/src/components/SavePageControls/GrantSelector/GrantSelector.tsx

@@ -21,7 +21,7 @@ const AVAILABLE_GRANTS = [
     grant: PageGrant.GRANT_PUBLIC, iconName: 'group', btnStyleClass: 'outline-info', label: 'Public',
     grant: PageGrant.GRANT_PUBLIC, iconName: 'group', btnStyleClass: 'outline-info', label: 'Public',
   },
   },
   {
   {
-    grant: PageGrant.GRANT_RESTRICTED, iconName: 'link', btnStyleClass: 'outline-teal', label: 'Anyone with the link',
+    grant: PageGrant.GRANT_RESTRICTED, iconName: 'link', btnStyleClass: 'outline-success', label: 'Anyone with the link',
   },
   },
   // { grant: 3, iconClass: '', label: 'Specified users only' },
   // { grant: 3, iconClass: '', label: 'Specified users only' },
   {
   {
@@ -30,7 +30,7 @@ const AVAILABLE_GRANTS = [
   {
   {
     grant: PageGrant.GRANT_USER_GROUP,
     grant: PageGrant.GRANT_USER_GROUP,
     iconName: 'more_horiz',
     iconName: 'more_horiz',
-    btnStyleClass: 'outline-purple',
+    btnStyleClass: 'outline-warning',
     label: 'Only inside the group',
     label: 'Only inside the group',
     reselectLabel: 'Reselect the group',
     reselectLabel: 'Reselect the group',
   },
   },
@@ -39,6 +39,7 @@ const AVAILABLE_GRANTS = [
 
 
 type Props = {
 type Props = {
   disabled?: boolean,
   disabled?: boolean,
+  openInModal?: boolean,
   grant: PageGrant,
   grant: PageGrant,
   userRelatedGrantedGroups?: {
   userRelatedGrantedGroups?: {
     id: string,
     id: string,
@@ -57,6 +58,7 @@ export const GrantSelector = (props: Props): JSX.Element => {
 
 
   const {
   const {
     disabled,
     disabled,
+    openInModal,
     userRelatedGrantedGroups,
     userRelatedGrantedGroups,
     onUpdateGrant,
     onUpdateGrant,
     grant: currentGrant,
     grant: currentGrant,
@@ -162,13 +164,13 @@ export const GrantSelector = (props: Props): JSX.Element => {
           <DropdownToggle color={dropdownToggleBtnColor} caret className="d-flex justify-content-between align-items-center" disabled={disabled}>
           <DropdownToggle color={dropdownToggleBtnColor} caret className="d-flex justify-content-between align-items-center" disabled={disabled}>
             {dropdownToggleLabelElm}
             {dropdownToggleLabelElm}
           </DropdownToggle>
           </DropdownToggle>
-          <DropdownMenu container="body">
+          <DropdownMenu container={openInModal ? '' : 'body'}>
             {dropdownMenuElems}
             {dropdownMenuElems}
           </DropdownMenu>
           </DropdownMenu>
         </UncontrolledDropdown>
         </UncontrolledDropdown>
       </div>
       </div>
     );
     );
-  }, [changeGrantHandler, currentGrant, disabled, userRelatedGrantedGroups, t]);
+  }, [changeGrantHandler, currentGrant, disabled, userRelatedGrantedGroups, t, openInModal]);
 
 
   /**
   /**
    * Render select grantgroup modal.
    * Render select grantgroup modal.