Skip to content

Commit

Permalink
fix: factor out url
Browse files Browse the repository at this point in the history
  • Loading branch information
louisewang1 committed Mar 4, 2022
1 parent b1a2e67 commit 6f7adf5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/item/sharing/CCLicenseSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ import { MUTATION_KEYS } from '@graasp/query-client';
import { redirect } from '@graasp/utils';
import { useMutation } from '../../../config/queryClient';
import { CurrentUserContext } from '../../context/CurrentUserContext';
import { CC_LICENSE_ADAPTION_OPTIONS } from '../../../config/constants';
import {
CC_LICENSE_ABOUT_URL,
CC_LICENSE_ADAPTION_OPTIONS,
} from '../../../config/constants';
import CCLicenseDialog from './CCLicenseDialog';

const useStyles = makeStyles((theme) => ({
Expand Down Expand Up @@ -67,7 +70,7 @@ const CCLicenseSelection = ({ item, edit }) => {
};

const handleClick = () => {
const url = 'https://creativecommons.org/about/cclicenses/';
const url = CC_LICENSE_ABOUT_URL;
redirect(url, { openInNewTab: true });
};

Expand Down
3 changes: 3 additions & 0 deletions src/config/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,6 @@ export const CC_LICENSE_ADAPTION_OPTIONS = {
ALLOW: 'allow',
ALIKE: 'alike',
};

export const CC_LICENSE_ABOUT_URL =
'https://creativecommons.org/about/cclicenses/';

0 comments on commit 6f7adf5

Please sign in to comment.