File .deepsource.toml
not found in the default branch of the repository root. Please refer to the docs.
65
66 if (!isAuthenticated) {
67 return (
68 <> 69 <div className="grid h-screen place-items-center"> 70 <div className=" space-y-4"> 71 <Card 72 title="Login" 73 className="flex flex-col" 74 style={{ 75 borderRadius: "0.5rem", 76 borderWidth: "2px", 77 borderColor: "#EAEAEB", 78 borderStyle: "solid", 79 }} 80 > 81 <Form onFinish={handleUpdatePassword} name="normal_login"> 82 <label htmlFor="password">New Password</label> 83 <Form.Item> 84 <Input 85 type="password" 86 name="password" 87 value={password} 88 defaultValue="password123" 89 onChange={handlePasswordChange} 90 /> 91 <div> 92 {error && <small className="text-danger">{error}</small>} 93 </div> 94 </Form.Item> 95 <Form.Item> 96 <Button htmlType="submit">Change Password</Button> 97 </Form.Item> 98 </Form> 99 </Card>100 <div>101 <Button type="primary" onClick={() => navigate("/login")}>102 Login103 </Button>104 </div>105 </div>106 {mutation.isLoading && <LoadingSpinner />}107 </div>108 </>109 );
110 }
111
85
86 if (!isAuthenticated) {
87 return (
88 <> 89 <div className="grid h-screen place-items-center"> 90 <div className="space-y-4"> 91 <Card 92 title="Login" 93 className="flex flex-col" 94 style={{ 95 borderRadius: "0.5rem", 96 borderWidth: "2px", 97 borderColor: "#EAEAEB", 98 borderStyle: "solid", 99 }}100 >101 {/* <img src="../assets/images/logo_large.jpg" alt="logo" /> */}102 <Form onFinish={handleLogin} name="normal_login">103 <Form.Item>104 <label htmlFor="username">Username or Email</label>105 <Input106 type="text"107 name="username"108 value={username}109 defaultValue="username123"110 onChange={handleUserNameChange}111 />112 </Form.Item>113 <label htmlFor="password">Password</label>114115 <Form.Item>116 <Input117 type="password"118 name="password"119 value={password}120 defaultValue="password123"121 onChange={handlePasswordChange}122 />123 <div>124 {error && <small className="text-danger">{error}</small>}125 </div>126 </Form.Item>127 <Form.Item>128 <Button htmlType="submit">Login</Button>129 </Form.Item>130 <Link131 to="/reset-password"132 className=" text-darkgold hover:text-black"133 >134 Forgot Password?135 </Link>136 </Form>137 </Card>138 {(import.meta.env.VITE_API_URL !== "https://api.uselotus.io/" ||139 import.meta.env.IS_DEMO == "true") && (140 <div>141 <Button142 type="primary"143 className="w-full"144 onClick={() => navigate("/register")}145 >146 Sign Up147 </Button>148 </div>149 )}150 </div>151 {mutation.isLoading && <LoadingSpinner />}152 </div>153 </>154 );
155 }
156
Fragments are a syntax that allow you to build a react component with multiple nodes or subcomponents, without requiring a wrapper element.
A fragment is considered to be redundant if:
Removing the fragments can fix this issue.
// Example 1
<>{foo}</>
// Example 2
<><Foo /></>
// Example 3
<p><>foo</></p>
// Example 4
<></>
// Example 5
<Fragment>foo</Fragment>
// Example 6
<React.Fragment>foo</React.Fragment>
// Example 7
<section>
<>
<div />
<div />
</>
</section>
// Example 1
<>
<Foo />
<Bar />
</>
// Example 2
<>foo {bar}</>
// Example 3
<> {foo}</>
// Example 4
const cat = <>meow</>
// Example 5
<SomeComponent>
<>
<div />
<div />
</>
</SomeComponent>
// Example 6
<Fragment key={item.id}>{item.value}</Fragment>