-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from phshy0607/dev
0.8.2
- Loading branch information
Showing
19 changed files
with
361 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// 研发流程 | ||
// feature分支从Master拉 | ||
// dev分支为预发布分支 | ||
// dev分支验证完成后在master分支进行发布,修改Changelog | ||
|
||
// beta release | ||
// beta版在feature上发, | ||
// changelog体现新版本,有unreleased | ||
// build => .... => publish | ||
|
||
// main release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React, { useState, useEffect, useMemo } from "react"; | ||
import { IFrameToolsProps } from "./types"; | ||
import { StyledIFrameTools, StyledQrCode, StyledIconWrapper } from "./styled"; | ||
import qrcode from "qrcode"; | ||
import { Svgs } from "../Svgs/index"; | ||
|
||
const IFrameTools: React.FC<IFrameToolsProps> = (props) => { | ||
const { moduleId } = props; | ||
const [qrCodeSrc, setQrCodeSrc] = useState(null); | ||
const url = useMemo(() => { | ||
return `${import.meta.env.BASE_URL}#sandbox?moduleId=${moduleId}`; | ||
}, [moduleId]); | ||
|
||
useEffect(() => { | ||
qrcode | ||
.toDataURL(url, { | ||
margin: 0, | ||
}) | ||
.then((res) => { | ||
setQrCodeSrc(res); | ||
}); | ||
}, [url]); | ||
|
||
return ( | ||
<StyledIFrameTools className="bottom-tools"> | ||
{qrCodeSrc && ( | ||
<StyledQrCode src={qrCodeSrc}> | ||
<div className="qrcode-wrapper"> | ||
<Svgs.QRCode height="20px" width="20px" /> | ||
</div> | ||
</StyledQrCode> | ||
)} | ||
<StyledIconWrapper onClick={() => window.open(url)}> | ||
<Svgs.Forward | ||
style={{ cursor: "pointer" }} | ||
height="20px" | ||
width="20px" | ||
/> | ||
</StyledIconWrapper> | ||
</StyledIFrameTools> | ||
); | ||
}; | ||
|
||
export default IFrameTools; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import styled from "styled-components"; | ||
|
||
export const StyledIFrameTools = styled.div` | ||
visibility: hidden; | ||
position: fixed; | ||
left: 0; | ||
bottom: 0; | ||
display: flex; | ||
align-items: center; | ||
width: 100%; | ||
padding: 12px; | ||
`; | ||
|
||
export const StyledQrCode = styled.div<{ src: string }>` | ||
position: relative; | ||
margin-right: 12px; | ||
.qrcode-wrapper { | ||
position: relative; | ||
display: flex; | ||
align-items: center; | ||
} | ||
.qrcode-wrapper:hover:after { | ||
content: ""; | ||
position: absolute; | ||
top: -100px; | ||
left: 0px; | ||
width: 80px; | ||
height: 80px; | ||
background-image: url(${(props) => props.src}); | ||
background-repeat: no-repeat; | ||
background-size: contain; | ||
} | ||
`; | ||
|
||
export const StyledIconWrapper = styled.div` | ||
display: flex; | ||
align-items: center; | ||
margin-right: 12px; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface IFrameToolsProps { | ||
moduleId | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
import styled from 'styled-components' | ||
|
||
export const StyledSandBox = styled.div` | ||
:hover .bottom-tools { | ||
visibility: visible; | ||
} | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.