Git Product home page Git Product logo

codeisneverodd / practice-with-react-typescript-for-crypto-dictionary Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 5.9 MB

🔭 Explore 30,000+ cryptos with their real-time price, chart, supplied amount, and more!!

Home Page: https://codeisneverodd.github.io/practice-with-react-typescript-for-crypto-dictionary/

HTML 7.99% TypeScript 92.01%
typescript react html css styled-components react-query apexcharts react-helmet coinpaprika-api guide

practice-with-react-typescript-for-crypto-dictionary's Introduction

Crypto Dictionary

thumbnail-crypto-dictionary

Table of Contents

You can check result

Here: favicon-32x32

Languages

TypeScript JavaScript HTML5 CSS3

Frameworks

React

Notable Packages

styled-components React Query ApexCharts.js ReactHelmet

Design Tools

Figma

APIs

coinpaprika

coinpaprika

Guides

Make Skeleton Site

  1. Initialize project using Create React App, npx create-react-app my-app --template typescript.
  2. Erase useless files, in my case I delete all the files except App.tsx and index.tsx.
  3. Make api.ts file and define api functions.
  4. Install react-query via npm, npm i react-query.
  5. Make routes folder.
  6. Make Home.tsx file in routes folder and fetch all data you need by using api.ts and react-query.
  7. Make componets folder.
  8. Make Coin.tsx file in components folder and define the Coin component using props from Home.tsx.
  9. Make Detail.tsx file in routes folder and fetch all data you need by using api.ts and react-query.
  10. Install react-router-dom via npm, npm i react-router-dom.
  11. Make Router.tsx file and define routes for Home.tsx and Detail.tsx.
  12. Add Router component to App.tsx by importing it from Router.tsx.
  13. Add useParams in Detail.tsx file to get coinId parameter from url.
  14. Install apexcharts.js via npm, npm install apexcharts --save.
  15. Make Chart.tsx file in routes folder and fetch all data you need by using api.ts and react-query.
  16. Link Coin compenents in Home.tsx to navigate to Detail.tsx .
  17. Make Back Components in Detail.tsx to navigate to Home.tsx.
  18. Make MoreDetails Components in Detail.tsx.
  19. Make Tab in Detail.tsx show and hide Chart.tsx and MoreDetails.tsx. Done.

Result of Skeleton

Please dont' care about the coloring things in this stage, just fetch and show data.

image-20220306153432689

Color the skeletons

  1. Design it with design tools or something, in my case Figma.

image-20220306153945664

  1. Visit Google Fonts and select the fonts you want to use. Copy the <link> to embed.
  2. Install react-helmet via npm, npm install --save react-helmet.
  3. Add Helmet component above Router component and embed the link that we copied in step 2.
  4. Install styled-compents via npm, npm install --save styled-components.
  5. Make styles folder.
  6. Remove default settings in CSS. You can do this in various ways. In my case, define createGlobalStyle in App.tsx and copy and paste the code in here.
  7. Make styled.d.ts file in styles folder and declare module 'styled-components' and add interface DefaultTheme.
  8. Make theme.ts file in styles folder and define colors in themes using DefaultTheme you want to use. In my case, I defined darkTheme and lightTheme .
  9. Make global.d.ts file in src folder and declare modules to use image files.
  10. Show off your CSS skills! Make styled components in the files you need. If you have to make a identical styled components in different files, make styles.tsx file in styles folder, put them there, and import them where you need.

Result of Coloring

Please don't just copy my design or code. That doesn't help you at all.

스크린샷 2022-03-06 오후 4.07.28

스크린샷 2022-03-06 오후 4.07.48

스크린샷 2022-03-06 오후 4.08.30

스크린샷 2022-03-06 오후 4.08.48

Deploy

  1. You can deploy your website in various ways. In my case, I deployed by publishing files to gh-pages branch on GitHub.

  2. Make Repository on GitHub and push all the files.

  3. Install gh-pages via npm, npm install gh-pages --save-dev.

  4. Go to package.json and add "homepage" right above the last curly brace. Use https://user-id-here.github.io/repository-name-here

  5.    },
         "homepage": "https://codeisneverodd.github.io/practice-with-react-typescript-for-crypto-dictionary/"
       }
  6. Add "deploy" and "predeploy" to script in package.json.

  7.    "scripts": {
           "deploy": "gh-pages -d build",
           "predeploy": "npm run build"
         },
  8. Finish deployment by entering npm run deploy in the console.

Don't forget to add basename={process.env.PUBLIC_URL} in your BrowserRouter

Result of Deployment

IMG_6770

IMG_6771

IMG_6772

practice-with-react-typescript-for-crypto-dictionary's People

Contributors

codeisneverodd avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.