File tree Expand file tree Collapse file tree 1 file changed +25
-29
lines changed
packages/app/src/app/pages/Sandbox/Editor/Workspace/items/Deployment/Netlify/SiteInfo/Functions/Function Expand file tree Collapse file tree 1 file changed +25
-29
lines changed Original file line number Diff line number Diff line change 1- import { inject , hooksObserver } from 'app/componentConnectors ' ;
2- import React from 'react' ;
1+ import { Module } from '@codesandbox/common/lib/types ' ;
2+ import React , { FunctionComponent } from 'react' ;
33import LightningIcon from 'react-icons/lib/md/flash-on' ;
4+
5+ import { useOvermind } from 'app/overmind' ;
6+
47import { Link } from '../../../../elements' ;
58
69type Props = {
7- function : {
8- title : string ;
9- } ;
10- store : any ;
10+ function : Module ;
1111} ;
12- export const Function = inject ( 'store' ) (
13- hooksObserver (
14- ( {
15- function : { title } ,
16- store : {
17- deployment : {
18- building,
19- netlifySite : { url : siteUrl } ,
20- } ,
12+ export const Function : FunctionComponent < Props > = ( { function : { title } } ) => {
13+ const {
14+ state : {
15+ deployment : {
16+ building,
17+ netlifySite : { url : siteUrl } ,
2118 } ,
22- } : Props ) => {
23- const functionName = title . split ( '.js' ) [ 0 ] ;
19+ } ,
20+ } = useOvermind ( ) ;
21+ const functionName = title . split ( '.js' ) [ 0 ] ;
2422
25- return (
26- < Link
27- disabled = { building }
28- href = { `${ siteUrl } /.netlify/functions/${ functionName } ` }
29- >
30- < LightningIcon />
23+ return (
24+ < Link
25+ disabled = { building }
26+ href = { `${ siteUrl } /.netlify/functions/${ functionName } ` }
27+ >
28+ < LightningIcon />
3129
32- { functionName }
33- </ Link >
34- ) ;
35- }
36- )
37- ) ;
30+ { functionName }
31+ </ Link >
32+ ) ;
33+ } ;
You can’t perform that action at this time.
0 commit comments