Skip to content

Conversation

@Gopikrishnan200
Copy link
Collaborator

Basic TypeScript App on React Chef.

img

Comment on lines 2 to 26
return `import React from 'react'
import { BrowserRouter as Router } from 'react-router-dom'
import { createBrowserHistory } from 'history'
import Routes from './Routes'
// Block Components.
import { ErrorHandler, PageLoader } from './components/blocks'
import { withTranslation } from '@/${sourceDir.i18n}'
const browserHistory = createBrowserHistory()
function App() {
return (
<ErrorHandler>
<PageLoader />
<Router history={browserHistory}>
<Routes />
</Router>
</ErrorHandler>
)
}
export default withTranslation(App)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these need to be typescript typed code

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

function getSourceCode(appName, { sourceDir }) {
return `import React from 'react'
import { useNavigate } from 'react-router-dom'
import PropTypes from 'prop-types'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getSourceCode returning code should be typed code.

// UI Components.
import { Spinner } from '@/components/ui'
export default function PageLoader({ loading }) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

import { RoutePaths } from '@/utils'
// Lazy-loaded modules
const SignInModule = React.lazy(() =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typed code is missing. its javascript

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

// Utils.
import { RoutePaths } from '@/${sourceDir.utility}'
const Sidebar = (props) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typed code is missing. its javascript

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -0,0 +1,7 @@
import React from 'react'

const BlockLoader = ({ props }) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typed code is missing. its javascript

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

const [error, setError] = useState()
const [loading, setLoading] = useState(false)

useEffect(async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typed code is missing. its javascript

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

function useOnlineStatus() {
const [online, setOnline] = useState(window.navigator.onLine)

useEffect(() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typed code is missing. its javascript

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

const [error, setError] = useState()
const [loading, setLoading] = useState(false)

const postData = async (payload) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typed code is missing. its javascript

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

// Utils.
import { RoutePaths } from '@/utils'

const NotFound = () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typed code is missing. its javascript

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

"webpackLoaders",
"babel",
"basicTypescriptDev"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove empty spaces

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Sidebar: sidebarBlock,
TopBar: topBarBlock,
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep 1 space

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 222 to 225
if (isTypeScriptProjectType) {
const tsConfigFileName = `tsconfig.json`;
createFile(tsConfigFileName, getFileContent(tsConfigFileName));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this changes not required and its already exist in 226

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 257 to 264
let projectTypeName;
if (is_BasicTypeScriptProjectType) {
projectTypeName = 'basic';
} else if (isSlimTypeScriptProject(projectType)) {
projectTypeName = 'slim';
} else {
projectTypeName = projectType;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can is_BasicTypeScriptProjectType rename to isBasicTypeScriptProjectType

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

const browserHistory: History = createBrowserHistory()
const App: React.FC = () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try this below.

interface AppProps extends WithTranslation {}

const App: React.FC<AppProps> = (props) => {

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines +15 to +17
interface DashboardProps {
title?: string
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this need to be separate file in types/dashboard.ts

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already this file after installation it will add inside module folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants