add react and typescript

This commit is contained in:
João Geonizeli
2021-08-03 21:23:52 -03:00
parent 5b88865de8
commit 88542cdadd
20 changed files with 428 additions and 51 deletions

View File

@@ -1,27 +0,0 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
* vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
* files in this directory. Styles in this file should be added after the last require_* statement.
* It is generally better to create a new file per style scope.
*
*= require_tree .
*= require_self
*/
.grid {
display: grid;
}
.place-items-center {
place-items: center;
}
.h-screen {
height: 100vh;
}

View File

@@ -0,0 +1,11 @@
.grid {
display: grid;
}
.place-items-center {
place-items: center;
}
.h-screen {
height: 100vh;
}

View File

@@ -0,0 +1,5 @@
# frozen_string_literal: true
class HomeController < ApplicationController
def index
end
end

View File

@@ -0,0 +1,3 @@
# frozen_string_literal: true
module HomeHelper
end

View File

@@ -3,11 +3,13 @@
// a relevant structure within app/javascript and only use these pack files to reference
// that code so it'll be compiled.
import Rails from "@rails/ujs"
import Turbolinks from "turbolinks"
import * as ActiveStorage from "@rails/activestorage"
import "channels"
// import Rails from "@rails/ujs"
// import Turbolinks from "turbolinks"
// import * as ActiveStorage from "@rails/activestorage"
// import "channels"
Rails.start()
Turbolinks.start()
ActiveStorage.start()
// Rails.start()
// Turbolinks.start()
// ActiveStorage.start()
import './src/index'

View File

@@ -0,0 +1,19 @@
import React from "react"
import {
BrowserRouter as Router,
Switch,
Route,
} from "react-router-dom";
export const App = () => (
<Router>
<Switch>
<Route path="/about">
<div>About!</div>
</Route>
<Route path="/">
<div>Hello World!</div>
</Route>
</Switch>
</Router>
)

View File

@@ -0,0 +1,13 @@
import React from 'react'
import ReactDOM from 'react-dom'
import { App } from './App'
document.addEventListener('DOMContentLoaded', () => {
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>
,
document.getElementById('root'),
)
})

View File

@@ -0,0 +1 @@
<div id="root"></div>

View File

@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>XStake</title>
<title>X Stake</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>