mirror of
https://github.com/stan-smith/FossFLOW.git
synced 2025-12-27 00:19:14 -05:00
feat: adds link to Github repo in main menu
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React, { useState, useCallback } from 'react';
|
||||
import { Menu, MenuItem } from '@mui/material';
|
||||
import { Menu, MenuItem, Typography } from '@mui/material';
|
||||
import { Menu as MenuIcon } from '@mui/icons-material';
|
||||
import { UiElement } from 'src/components/UiElement/UiElement';
|
||||
import { IconButton } from 'src/components/IconButton/IconButton';
|
||||
@@ -22,6 +22,10 @@ export const MainMenu = () => {
|
||||
[setIsMainMenuOpen]
|
||||
);
|
||||
|
||||
const gotoGithub = useCallback(() => {
|
||||
window.open(REPOSITORY_URL, '_blank');
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<UiElement>
|
||||
<IconButton Icon={<MenuIcon />} name="Main menu" onClick={onClick} />
|
||||
@@ -43,6 +47,11 @@ export const MainMenu = () => {
|
||||
}}
|
||||
>
|
||||
<MenuItem>Export</MenuItem>
|
||||
<MenuItem onClick={gotoGithub}>
|
||||
<Typography variant="body2" color="text.secondary">
|
||||
Isoflow v{PACKAGE_VERSION}
|
||||
</Typography>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</UiElement>
|
||||
);
|
||||
|
||||
3
src/global.d.ts
vendored
3
src/global.d.ts
vendored
@@ -1,6 +1,9 @@
|
||||
import { Size, Coords, SceneInput } from 'src/types';
|
||||
|
||||
declare global {
|
||||
let PACKAGE_VERSION: string;
|
||||
let REPOSITORY_URL: string;
|
||||
|
||||
interface Window {
|
||||
Isoflow: {
|
||||
getUnprojectedBounds: () => Size & Coords;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
const path = require('path');
|
||||
const HtmlWebPackPlugin = require('html-webpack-plugin');
|
||||
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
||||
const webpack = require('webpack');
|
||||
|
||||
module.exports = {
|
||||
mode: 'development',
|
||||
@@ -48,6 +49,10 @@ module.exports = {
|
||||
plugins: [
|
||||
new HtmlWebPackPlugin({
|
||||
template: path.resolve(__dirname, '../src/index.html')
|
||||
}),
|
||||
new webpack.DefinePlugin({
|
||||
PACKAGE_VERSION: JSON.stringify(require("../package.json").version),
|
||||
REPOSITORY_URL: JSON.stringify(require("../package.json").repository.url),
|
||||
})
|
||||
]
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const path = require('path');
|
||||
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
||||
const webpack = require('webpack');
|
||||
|
||||
module.exports = {
|
||||
mode: 'production',
|
||||
@@ -48,6 +49,12 @@ module.exports = {
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
PACKAGE_VERSION: JSON.stringify(require("../package.json").version),
|
||||
REPOSITORY_URL: JSON.stringify(require("../package.json").repository.url),
|
||||
})
|
||||
],
|
||||
resolve: {
|
||||
extensions: ['.tsx', '.ts', '.js'],
|
||||
plugins: [new TsconfigPathsPlugin()]
|
||||
|
||||
Reference in New Issue
Block a user