Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SMU-GDMU-CHINA
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
2024 Competition
SMU-GDMU-CHINA
Commits
57e75ace
Commit
57e75ace
authored
9 months ago
by
Tianyi Liang
Browse files
Options
Downloads
Patches
Plain Diff
refactor: new attribution form
parent
3e832c28
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.env
+2
-0
2 additions, 0 deletions
.env
src/components/AttributionForm/index.tsx
+3
-3
3 additions, 3 deletions
src/components/AttributionForm/index.tsx
src/vite-env.d.ts
+1
-0
1 addition, 0 deletions
src/vite-env.d.ts
with
6 additions
and
3 deletions
.env
+
2
−
0
View file @
57e75ace
# Team ID
VITE_TEAM_ID=TeamID
# Team name
VITE_TEAM_NAME=TeamName
# Team year
...
...
This diff is collapsed.
Click to expand it.
src/components/AttributionForm/index.tsx
+
3
−
3
View file @
57e75ace
function
AttributionForm
()
{
const
team_
name
=
import
.
meta
.
env
.
VITE_TEAM_
NAME
;
const
team_
id
=
import
.
meta
.
env
.
VITE_TEAM_
ID
;
// Listen to size change and update form height
window
.
addEventListener
(
"
message
"
,
function
(
e
)
{
if
(
e
.
origin
===
"
https://
attribution
s.igem.org
"
)
{
if
(
e
.
origin
===
"
https://
team
s.igem.org
"
)
{
const
{
type
,
data
}
=
JSON
.
parse
(
e
.
data
);
if
(
type
===
"
igem-attribution-form
"
)
{
const
element
=
document
.
getElementById
(
"
igem-attribution-form
"
);
...
...
@@ -19,7 +19,7 @@ function AttributionForm() {
<
iframe
style
=
{
{
width
:
"
100%
"
}
}
id
=
"igem-attribution-form"
src
=
{
`https://
attribution
s.igem.org
?team=
${
team_
name
}
&year=2024
`
}
src
=
{
`https://
team
s.igem.org
/
${
team_
id
}
/attributions
`
}
/>
</>
);
...
...
This diff is collapsed.
Click to expand it.
src/vite-env.d.ts
+
1
−
0
View file @
57e75ace
/// <reference types="vite/client" />
interface
ImportMetaEnv
{
readonly
VITE_TEAM_ID
:
string
;
readonly
VITE_TEAM_NAME
:
string
;
readonly
VITE_TEAM_YEAR
:
string
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment