Skip to content

Commit

Permalink
feat: add donmain persona type (#335)
Browse files Browse the repository at this point in the history
Signed-off-by: laixingyou <[email protected]>
  • Loading branch information
coder-sett authored Mar 11, 2024
1 parent 1e54956 commit 0dac972
Show file tree
Hide file tree
Showing 6 changed files with 500 additions and 12 deletions.
2 changes: 1 addition & 1 deletion apps/web/i18n
Binary file not shown.
421 changes: 421 additions & 0 deletions apps/web/src/modules/academe/DataUsageProcess/DataTerms.tsx

Large diffs are not rendered by default.

57 changes: 57 additions & 0 deletions apps/web/src/modules/academe/DataUsageProcess/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import React, { useState } from 'react';
import { useTranslation } from 'next-i18next';
import Dialog, { Transition } from '@common/components/Dialog';
import classnames from 'classnames';
import { Button } from '@oss-compass/ui';
import DataTerms from './DataTerms';

const DataUsageProcess = () => {
const { t } = useTranslation();
const [open, setOpen] = useState(false);

return (
<>
<Dialog
TransitionComponent={Transition}
open={open}
classes={{
paper: classnames(
'border-2 border-black w-[840px] !max-w-[840px] !rounded-none !m-0 md:w-full md:h-full md:!m-0 md:!min-h-full md:border-none'
),
}}
dialogContent={<DataTerms />}
handleClose={() => {
setOpen(false);
}}
dialogActions={
<>
<Button
intent="text"
size="sm"
className="mr-2"
onClick={() => {
setOpen(false);
}}
>
{t('common:btn.confirm')}
</Button>
</>
}
/>
<div
className="h-10 cursor-pointer bg-gradient-to-r from-[#72D74F] to-[#27AE65] px-4 text-center text-sm leading-10 text-[#fff]"
onClick={() => {
setOpen(true);
}}
>
<a
// href="mailto:[email protected]"
title="[email protected]"
>
{t('academe:submit_your_application_now')}
</a>
</div>
</>
);
};
export default DataUsageProcess;
9 changes: 4 additions & 5 deletions apps/web/src/modules/academe/components/Banner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import classnames from 'classnames';
import { useTranslation } from 'next-i18next';
import Coutact from '../../Coutact';
import DataUsageProcess from '../../DataUsageProcess';
import style from './index.module.css';

const Banner = () => {
Expand All @@ -21,10 +22,7 @@ const Banner = () => {
></div>

<div className="relative mx-auto w-[1200px] pt-10 text-sm md:w-full md:px-2">
<div
className="h-[40px] text-4xl font-semibold
md:-right-[300px]"
>
<div className="h-[40px] text-4xl font-semibold md:-right-[300px]">
{t('academe:academic_research_cooperation')}
</div>
<div
Expand All @@ -35,8 +33,9 @@ const Banner = () => {
>
{t('academe:academic_research_desc')}
</div>
<div className="flex">
<div className="flex gap-4">
<Coutact />
<DataUsageProcess />
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ const useContributionTypeMap = () => {
const { t } = useTranslation();
return {
Code: {
// code_author #code 编写
// code_review #代码审查
code_author: t('analyze:metric_detail:code:code_creation'),
code_committer: t('analyze:metric_detail:code:code_committer'),
code_review: t('analyze:metric_detail:code:code_review'), //delete
code_commit: t('analyze:metric_detail:code:code_commit'), //delete
pr_creation: t('analyze:metric_detail:code:pr_creation'),
pr_comments: t('analyze:metric_detail:code:pr_comments'),
code_commit: t('analyze:metric_detail:code:code_commit'),
},
'Code Admin': {
pr_labeled: t('analyze:metric_detail:code_admin:pr_labeled'),
Expand Down Expand Up @@ -48,7 +53,7 @@ const useContributionTypeMap = () => {
pr_unlink_issue: t('analyze:metric_detail:code_admin:pr_unlink_issue'),
code_direct_commit: t(
'analyze:metric_detail:code_admin:code_direct_commit'
),
), //delete
},
Issue: {
issue_creation: t('analyze:metric_detail:issue:issue_creation'),
Expand Down Expand Up @@ -122,10 +127,16 @@ export const useContributionTypeLsit = () => {
for (const key in obj) {
const children = [];
for (const childKey in obj[key]) {
children.push({
text: obj[key][childKey],
value: childKey,
});
if (
childKey !== 'code_commit' &&
childKey !== 'code_direct_commit' &&
childKey !== 'code_review'
) {
children.push({
text: obj[key][childKey],
value: childKey,
});
}
}
result.push({
text: key,
Expand Down

0 comments on commit 0dac972

Please sign in to comment.