Skip to content

Commit

Permalink
Converted into PWA #9
Browse files Browse the repository at this point in the history
  • Loading branch information
Amit366 committed Jan 19, 2021
1 parent 0add507 commit 4dc2659
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
1 change: 1 addition & 0 deletions .eslintcache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"C:\\Users\\Amit kumar mishra\\Desktop\\idea-lab\\src\\index.js":"1","C:\\Users\\Amit kumar mishra\\Desktop\\idea-lab\\src\\reportWebVitals.js":"2","C:\\Users\\Amit kumar mishra\\Desktop\\idea-lab\\src\\App.js":"3","C:\\Users\\Amit kumar mishra\\Desktop\\idea-lab\\src\\Components\\Card\\card.js":"4","C:\\Users\\Amit kumar mishra\\Desktop\\idea-lab\\src\\Components\\Home\\Nav.js":"5","C:\\Users\\Amit kumar mishra\\Desktop\\idea-lab\\src\\Components\\Newsletter\\letterForm.js":"6","C:\\Users\\Amit kumar mishra\\Desktop\\idea-lab\\src\\Components\\Newsletter\\subsForm.js":"7","C:\\Users\\Amit kumar mishra\\Desktop\\idea-lab\\src\\Logo.js":"8","C:\\Users\\Amit kumar mishra\\Desktop\\idea-lab\\src\\constants\\const.js":"9"},{"size":576,"mtime":1611037144126,"results":"10","hashOfConfig":"11"},{"size":375,"mtime":1611037144127,"results":"12","hashOfConfig":"11"},{"size":415,"mtime":1611037144105,"results":"13","hashOfConfig":"11"},{"size":2926,"mtime":1611037144113,"results":"14","hashOfConfig":"11"},{"size":4889,"mtime":1611037144116,"results":"15","hashOfConfig":"11"},{"size":3271,"mtime":1611037144119,"results":"16","hashOfConfig":"11"},{"size":3139,"mtime":1611037144121,"results":"17","hashOfConfig":"11"},{"size":225,"mtime":1611037144122,"results":"18","hashOfConfig":"11"},{"size":49,"mtime":1611037144125,"results":"19","hashOfConfig":"11"},{"filePath":"20","messages":"21","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"22"},"1x8hd3c",{"filePath":"23","messages":"24","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"22"},{"filePath":"25","messages":"26","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"22"},{"filePath":"27","messages":"28","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"22"},{"filePath":"29","messages":"30","errorCount":0,"warningCount":11,"fixableErrorCount":0,"fixableWarningCount":0,"source":"31","usedDeprecatedRules":"22"},{"filePath":"32","messages":"33","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"34","usedDeprecatedRules":"22"},{"filePath":"35","messages":"36","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"37","usedDeprecatedRules":"22"},{"filePath":"38","messages":"39","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"22"},{"filePath":"40","messages":"41","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\Amit kumar mishra\\Desktop\\idea-lab\\src\\index.js",[],["42","43"],"C:\\Users\\Amit kumar mishra\\Desktop\\idea-lab\\src\\reportWebVitals.js",[],"C:\\Users\\Amit kumar mishra\\Desktop\\idea-lab\\src\\App.js",[],"C:\\Users\\Amit kumar mishra\\Desktop\\idea-lab\\src\\Components\\Card\\card.js",[],"C:\\Users\\Amit kumar mishra\\Desktop\\idea-lab\\src\\Components\\Home\\Nav.js",["44","45","46","47","48","49","50","51","52","53","54"],"import React, {useState} from \"react\";\r\nimport {CloseOutlined,MenuOutlined} from \"@ant-design/icons\";\r\nimport Logo from \"../../Logo\";\r\n\r\nexport default function Nav() {\r\n\r\n const [navButton, setNavButton] = useState(false);\r\n \r\n return (\r\n <div className=\"relative bg-opacity-0\">\r\n <div className=\"max-w-7xl mx-auto px-4 sm:px-6\">\r\n <div className=\"flex justify-between items-center py-6 md:justify-start md:space-x-10\">\r\n <div className=\"flex justify-start lg:w-0 lg:flex-1\">\r\n <a href=\"#\">\r\n <span className=\"sr-only\">Workflow</span>\r\n <Logo />\r\n </a>\r\n </div>\r\n <div className=\"hidden md:flex items-center justify-end md:flex-1 lg:w-0\">\r\n <a\r\n href=\"#\"\r\n className=\"whitespace-nowrap text-base font-bold text-black-500 hover:text-black-900 mx-8\"\r\n >\r\n Home\r\n </a>\r\n <a\r\n href=\"#\"\r\n className=\"whitespace-nowrap text-base font-bold text-black-500 hover:text-black-900 mx-8\"\r\n >\r\n Join\r\n </a>\r\n <a\r\n href=\"#\"\r\n className=\"whitespace-nowrap text-base font-bold text-black-500 hover:text-black-900 mx-8\"\r\n >\r\n About\r\n </a>\r\n <a\r\n href=\"#\"\r\n className=\"whitespace-nowrap text-base font-bold text-black-500 hover:text-black-900 mx-8\"\r\n >\r\n Help\r\n </a>\r\n <a\r\n href=\"#\"\r\n className=\"ml-8 whitespace-nowrap inline-flex items-center justify-center px-4 py-2 border border-transparent rounded-full shadow-sm text-base font-medium text-white bg-indigo-600 hover:bg-indigo-700 shadow-xl \"\r\n >\r\n Share Your idea\r\n </a>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"absolute top-0 inset-x-0 p-2 transition transform origin-top-right md:hidden\">\r\n <div className=\"rounded-lg shadow-lg ring-1 ring-black ring-opacity-5 bg-white divide-y-2 divide-gray-50\">\r\n <div className=\"pt-5 pb-6 px-5\">\r\n <div className=\"flex items-center justify-between\">\r\n <div>\r\n <Logo />\r\n </div>\r\n <div className=\"-mr-2\">\r\n <button\r\n type=\"button\"\r\n className=\"bg-white rounded-md p-2 inline-flex items-center justify-center text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500\"\r\n onClick={() => setNavButton(current => !current)}\r\n >\r\n {\r\n navButton ?\r\n <>\r\n <span className=\"sr-only\">Close menu</span>\r\n <span><CloseOutlined className=\"h-6 w-6\"/></span>\r\n </>\r\n :\r\n <>\r\n <span className=\"sr-only\">Close menu</span>\r\n <span>\r\n <MenuOutlined className=\"h-6 w-6\"/></span>\r\n </>\r\n }\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n {\r\n navButton && \r\n <div className=\"py-6 px-5 space-y-6\">\r\n <div className=\"grid grid-cols-2 gap-y-4 gap-x-8\">\r\n <a\r\n href=\"#\"\r\n className=\"w-full flex items-center justify-center px-4 py-2 text-base font-medium text-gray-900 hover:text-gray-700\"\r\n >\r\n Home\r\n </a>\r\n\r\n <a\r\n href=\"#\"\r\n className=\"w-full flex items-center justify-center px-4 py-2 text-base font-medium text-gray-900 hover:text-gray-700\"\r\n >\r\n Join\r\n </a>\r\n\r\n <a\r\n href=\"#\"\r\n className=\"w-full flex items-center justify-center px-4 py-2 text-base font-medium text-gray-900 hover:text-gray-700\"\r\n >\r\n About\r\n </a>\r\n\r\n <a\r\n href=\"#\"\r\n className=\"w-full flex items-center justify-center px-4 py-2 text-base font-medium text-gray-900 hover:text-gray-700\"\r\n >\r\n Help\r\n </a>\r\n\r\n <a\r\n href=\"#\"\r\n className=\"w-full flex items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-base font-medium text-white bg-indigo-600 hover:bg-indigo-700\"\r\n >\r\n Share your idea\r\n </a>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n","C:\\Users\\Amit kumar mishra\\Desktop\\idea-lab\\src\\Components\\Newsletter\\letterForm.js",["55","56"],"import React, { Component } from 'react';\r\nimport {BASE_URL} from '../../constants/const';\r\n\r\nexport class Letterform extends Component {\r\n constructor(props) {\r\n super(props);\r\n\r\n this.state = {\r\n heading: '',\r\n content: ''\r\n };\r\n }\r\n headingChangeHandler = (evt) => {\r\n this.setState({heading : evt.target.value});\r\n }\r\n contentChangeHandler = (evt) => {\r\n this.setState({content : evt.target.value});\r\n }\r\n letterSubmitHandler = (evt) => {\r\n evt.preventDefault();\r\n console.log(this.state);\r\n try {\r\n let result = fetch( BASE_URL +'letter/mail', {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Accept': 'application/json'\r\n },\r\n body: JSON.stringify(this.state)\r\n })\r\n result.then((res) => { \r\n if(res.status === 204) {\r\n alert(\"No Mail in Mailing list\");\r\n \r\n } else if(res.status === 200) {\r\n alert(\"Successfully mailed\")\r\n \r\n } else {\r\n alert(\"Something went wrong!!\");\r\n }\r\n this.setState({heading:'', content:''});\r\n })\r\n } catch (error) {\r\n alert(\"Something went wrong\");\r\n }\r\n }\r\n render() {\r\n return (\r\n <div className=\"newsletter bg-gray-50\">\r\n <h2 className=\"mg-bottom text-3xl font-extrabold tracking-tight text-gray-900 sm:text-4xl\">\r\n <span className=\"block text-iblue-600\">Publish a Newsletter!</span>\r\n </h2>\r\n <form onSubmit={this.letterSubmitHandler}>\r\n <label htmlFor=\"heading\">Heading</label>\r\n <br></br>\r\n <input id=\"heading\" required spellCheck=\"false\"\r\n className=\"nl-input inline-flex items-center justify-center px-5 py-3 border border-transparent text-base font-medium rounded-md text-indigo-600 bg-white hover:bg-indigo-50\" \r\n type=\"text\" spellCheck=\"false\" value={this.state.heading} onChange={this.headingChangeHandler}/>\r\n <br></br>\r\n <br></br>\r\n <label htmlFor=\"content\">Content</label>\r\n <br></br>\r\n <textarea spellCheck=\"false\" id=\"content\" required spellCheck=\"false\"\r\n className=\"nl-input inline-flex items-center justify-center px-5 py-3 border border-transparent text-base font-medium rounded-md text-indigo-600 bg-white hover:bg-indigo-50\" \r\n value={this.state.content} onChange={this.contentChangeHandler}></textarea>\r\n <br></br>\r\n <br></br>\r\n <button type=\"submit\"\r\n className=\"mg-bottom inline-flex items-center justify-center px-5 py-3 border border-transparent text-base font-medium rounded-md text-white bg-iblue-600 hover:bg-iblue-700\"\r\n >Publish</button>\r\n </form> \r\n </div>\r\n )\r\n }\r\n}\r\n\r\nexport default Letterform;\r\n","C:\\Users\\Amit kumar mishra\\Desktop\\idea-lab\\src\\Components\\Newsletter\\subsForm.js",["57"],"import React, { Component } from 'react';\r\nimport {BASE_URL} from '../../constants/const';\r\n\r\nexport default class Subsform extends Component {\r\n constructor(props) {\r\n super(props);\r\n\r\n this.state = {\r\n email: ''\r\n };\r\n }\r\n emailChangeHandler = (evt) => {\r\n this.setState({email : evt.target.value});\r\n }\r\n subsHandler = (evt) => {\r\n evt.preventDefault();\r\n this.setState(()=>{\r\n this.state.email = this.state.email.trim();\r\n })\r\n try {\r\n let result = fetch( BASE_URL + 'letter/register', {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Accept': 'application/json'\r\n },\r\n body: JSON.stringify(this.state)\r\n })\r\n result.then((res) => { \r\n if(res.status === 201) {\r\n alert(\"Already Subscribed\");\r\n \r\n } else if(res.status === 200) {\r\n alert(\"Successfully Subscribed\")\r\n \r\n } else {\r\n alert(\"Something went wrong!!\");\r\n }\r\n this.setState({email:''});\r\n })\r\n } catch (error) {\r\n alert(\"Something went wrong... Try again.\");\r\n }\r\n }\r\n render() {\r\n return (\r\n <div className=\"newsletter\">\r\n <div className=\"bg-gray-50\">\r\n <div className=\"max-w-7xl mx-auto py-12 px-4 sm:px-6 lg:py-16 lg:px-8 lg:flex lg:items-center lg:justify-between\">\r\n <h2 className=\"text-3xl font-extrabold tracking-tight text-gray-900 sm:text-4xl\">\r\n <span className=\"block\">Ready to dive in?</span>\r\n <span className=\"block text-iblue-600\">Subscribe to our Newsletters!</span>\r\n </h2>\r\n <form className=\"mt-8 lex lg:mt-0 lg:flex-shrink-0\" onSubmit={this.subsHandler}>\r\n <div className=\"subs-div inline-flex rounded-md shadow\">\r\n <input type=\"email\" required\r\n value={this.state.email} onChange={this.emailChangeHandler} placeholder=\"Email\"\r\n className=\"nl-input inline-flex items-center justify-center px-5 py-3 border border-transparent text-base font-medium rounded-md text-indigo-600 bg-white hover:bg-indigo-50\"></input>\r\n </div>\r\n <div className=\"inline-flex rounded-md shadow\">\r\n <button type=\"submit\" className=\"inline-flex items-center justify-center px-5 py-3 border border-transparent text-base font-medium rounded-md text-white bg-iblue-600 hover:bg-iblue-700\">\r\n Subscribe\r\n </button>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n </div> \r\n )\r\n }\r\n}\r\n","C:\\Users\\Amit kumar mishra\\Desktop\\idea-lab\\src\\Logo.js",[],"C:\\Users\\Amit kumar mishra\\Desktop\\idea-lab\\src\\constants\\const.js",[],{"ruleId":"58","replacedBy":"59"},{"ruleId":"60","replacedBy":"61"},{"ruleId":"62","severity":1,"message":"63","line":14,"column":13,"nodeType":"64","endLine":14,"endColumn":25},{"ruleId":"62","severity":1,"message":"63","line":20,"column":13,"nodeType":"64","endLine":23,"endColumn":14},{"ruleId":"62","severity":1,"message":"63","line":26,"column":13,"nodeType":"64","endLine":29,"endColumn":14},{"ruleId":"62","severity":1,"message":"63","line":32,"column":13,"nodeType":"64","endLine":35,"endColumn":14},{"ruleId":"62","severity":1,"message":"63","line":38,"column":13,"nodeType":"64","endLine":41,"endColumn":14},{"ruleId":"62","severity":1,"message":"63","line":44,"column":13,"nodeType":"64","endLine":47,"endColumn":14},{"ruleId":"62","severity":1,"message":"63","line":88,"column":17,"nodeType":"64","endLine":91,"endColumn":18},{"ruleId":"62","severity":1,"message":"63","line":95,"column":17,"nodeType":"64","endLine":98,"endColumn":18},{"ruleId":"62","severity":1,"message":"63","line":102,"column":17,"nodeType":"64","endLine":105,"endColumn":18},{"ruleId":"62","severity":1,"message":"63","line":109,"column":17,"nodeType":"64","endLine":112,"endColumn":18},{"ruleId":"62","severity":1,"message":"63","line":116,"column":17,"nodeType":"64","endLine":119,"endColumn":18},{"ruleId":"65","severity":1,"message":"66","line":58,"column":33,"nodeType":"67","endLine":58,"endColumn":51},{"ruleId":"65","severity":1,"message":"66","line":63,"column":72,"nodeType":"67","endLine":63,"endColumn":90},{"ruleId":"68","severity":1,"message":"69","line":18,"column":13,"nodeType":"70","endLine":18,"endColumn":23},"no-native-reassign",["71"],"no-negated-in-lhs",["72"],"jsx-a11y/anchor-is-valid","The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md","JSXOpeningElement","react/jsx-no-duplicate-props","No duplicate props allowed","JSXAttribute","react/no-direct-mutation-state","Do not mutate state directly. Use setState().","MemberExpression","no-global-assign","no-unsafe-negation"]
22 changes: 10 additions & 12 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"name": "Idea-Lab",
"short_name": "CSS app",
"theme_color": "#000000",
"background_color": "#000000",
"display": "standalone",
"scope": "/",
"start_url": "/",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},

{
"src": "logo192.png",
"type": "image/png",
Expand All @@ -17,9 +18,6 @@
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
]

}

0 comments on commit 4dc2659

Please sign in to comment.