Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
boytacean
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
João Magalhães
boytacean
Commits
9f0ff33e
Verified
Commit
9f0ff33e
authored
2 years ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
feat: link support for children
parent
be1b91c8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!8
Support for react.js components
Pipeline
#1157
passed
2 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/web/react/components/link/link.tsx
+11
-4
11 additions, 4 deletions
examples/web/react/components/link/link.tsx
examples/web/react/components/title/title.tsx
+1
-1
1 addition, 1 deletion
examples/web/react/components/title/title.tsx
with
12 additions
and
5 deletions
examples/web/react/components/link/link.tsx
+
11
−
4
View file @
9f0ff33e
import
React
,
{
FC
}
from
"
react
"
;
import
React
,
{
ReactNode
,
FC
}
from
"
react
"
;
import
"
./link.css
"
;
type
LinkProps
=
{
text
:
string
;
children
?:
ReactNode
;
text
?:
string
;
href
?:
string
;
target
?:
string
;
style
?:
string
[];
};
export
const
Link
:
FC
<
LinkProps
>
=
({
text
,
href
,
target
,
style
=
[]
})
=>
{
export
const
Link
:
FC
<
LinkProps
>
=
({
children
,
text
,
href
,
target
,
style
=
[]
})
=>
{
const
classes
=
()
=>
[
"
link
"
,
...
style
].
join
(
"
"
);
return
(
<
a
className
=
{
classes
()
}
href
=
{
href
}
target
=
{
target
}
>
{
text
}
{
children
||
text
}
</
a
>
);
};
...
...
This diff is collapsed.
Click to expand it.
examples/web/react/components/title/title.tsx
+
1
−
1
View file @
9f0ff33e
...
...
@@ -23,7 +23,7 @@ export const Title: FC<TitleProps> = ({
<
h1
className
=
{
classes
()
}
>
{
text
}
{
version
&&
(
<
Link
text
=
{
version
}
href
=
{
versionUrl
}
target
=
"_blank"
></
Link
>
<
Link
href
=
{
versionUrl
}
target
=
"_blank"
>
{
version
}
</
Link
>
)
}
{
iconSrc
&&
<
img
className
=
"icon"
src
=
{
iconSrc
}
alt
=
"icon"
/>
}
</
h1
>
...
...
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