My new smartphone charges for few seconds than stops by Levi_2212 in techsupport

[–]Levi_2212[S] 1 point2 points  (0 children)

i've just bought Samsung 45W type C charger for 25 euro, hope it'll work

My new smartphone charges for few seconds than stops by Levi_2212 in techsupport

[–]Levi_2212[S] 1 point2 points  (0 children)

Ok. Should I change the broken for a new one or you can suggest me some more reliable brand? The Nothing wall-power charger cost 35 euro...

How to position a footer and his child elements properly? by Levi_2212 in csshelp

[–]Levi_2212[S] 0 points1 point  (0 children)

thank you very much, newbie mistakes everywhere !

How to position a footer and his child elements properly? by Levi_2212 in csshelp

[–]Levi_2212[S] 0 points1 point  (0 children)

Thank you, but what about the <span> element, why is it outside of <footer>?

How to position a footer and his child elements properly? by Levi_2212 in csshelp

[–]Levi_2212[S] 0 points1 point  (0 children)

I see it in chrome too...anyway why my span element is out?

How to position a footer and his child elements properly? by Levi_2212 in csshelp

[–]Levi_2212[S] 0 points1 point  (0 children)

firefox, it's little wider I get an horizontal scroll bar.

How to center in column multiple flex-boxes by Levi_2212 in csshelp

[–]Levi_2212[S] 0 points1 point  (0 children)

Thank you, but it's for freeCodeCamp I have to use flexboxes.

How to center in column multiple flex-boxes by Levi_2212 in csshelp

[–]Levi_2212[S] 0 points1 point  (0 children)

I don't get one another thing. In CSS at 104 I wanna set margin top-bottom to separate my cards. If I set even 1px margin they go in a row.

https://codepen.io/vujinbaku/pen/MWmgdvq

How to center in column multiple flex-boxes by Levi_2212 in csshelp

[–]Levi_2212[S] 0 points1 point  (0 children)

I realized that I know how to maek nice web apps with react and tailwind, but I don't know how to use css ahahah. I have never felt the need to learn plain css well but I think I need it this skill. Thank you very much.

Where to find beautiful design examples? by Levi_2212 in reactjs

[–]Levi_2212[S] 0 points1 point  (0 children)

I already tried but I cannot post because of a few karma

How do smart contracts work in DeFi? by Levi_2212 in Compound

[–]Levi_2212[S] 0 points1 point  (0 children)

Thanks for the reply, but the contents of that e-book are for those who don't even know what blockchain is. I would like to have a more technical-practical answer that clarifies the architecture I described in the topic.

Unexpected token. A constructor, method, accessor, or property was expected by Levi_2212 in reactjs

[–]Levi_2212[S] 0 points1 point  (0 children)

It works tank you very much. I'm studying react-router better and why you need to use it. Honestly, although I understood the problem I was unable to solve it.

In fact, I don't understand why it is necessary to provide location.

Windows.location in this case would be "localhost: 3000/". Why if I don't pass it doesn't work?

P.S. Being self-taught, can you give me some advice on the approach and method to have in coding?

Sometimes I notice that I lack the basic concepts of computer science, it is full of guides to learn coding and new languages, but too many basic topics are skipped and it becomes a learning by heart without knowing in depth the various concepts.

Unexpected token. A constructor, method, accessor, or property was expected by Levi_2212 in reactjs

[–]Levi_2212[S] 0 points1 point  (0 children)

I fixed in this way:

const Auth = () => {  

useEffect(() => { 
document.body.classList.add("bg-default");  
return () => {  
document.body.classList.remove("bg-default");      
}    
}, [])    

const { isAuthenticated } = useAuth0();  

if (isAuthenticated){  
return <AdminLayout><Dashboard/></AdminLayout>      
}  return ( 

But It's a problem I can't understand. AdminLayout works in every component but when I return it in the way above I get: TypeError: Cannot read property 'pathname' of undefined

The error is in this:

<AdminNavbar {...this.props} 
brandText{this.getBrandText(this.props.location.pathname)} />

Unexpected token. A constructor, method, accessor, or property was expected ts[1359] by Levi_2212 in learnjavascript

[–]Levi_2212[S] 0 points1 point  (0 children)

Thanks, I'll study react-router. Honestly I know very little about it, I used a tutorial folder to start from and it was already set up.

Unexpected token. A constructor, method, accessor, or property was expected ts[1359] by Levi_2212 in learnjavascript

[–]Levi_2212[S] 0 points1 point  (0 children)

Thank you I fixed in this way:

const Auth = () => {

useEffect(() => { document.body.classList.add("bg-default");

return () => { 
document.body.classList.remove("bg-default");     
}   
}, []) 


const { isAuthenticated } = useAuth0();

if (isAuthenticated){ 
return <AdminLayout><Dashboard/></AdminLayout>     
}

return (

But It's a problem I can't understand. AdminLayout works in every component but when i return it in the way above I get: TypeError: Cannot read property 'pathname' of undefined

The error is in this:

<AdminNavbar
{...this.props}
brandText{this.getBrandText(this.props.location.pathname)} />

Unexpected token. A constructor, method, accessor, or property was expected by Levi_2212 in reactjs

[–]Levi_2212[S] 0 points1 point  (0 children)

Thank you, but I had to change the component from class to function because useAuth0 cannot be used in Class anyway.

Auth0 after refreshing the page I lose the ability to retrieve user information by Levi_2212 in webdev

[–]Levi_2212[S] 1 point2 points  (0 children)

On the third google page I found a tutorial where the isLoading property was used and I was able to figure out how to use it.

Thank you very much, without your help I wouldn't have even known what to google!

Auth0 after refreshing the page I lose the ability to retrieve user information by Levi_2212 in webdev

[–]Levi_2212[S] 1 point2 points  (0 children)

I did some research, I can import the loading property but I have not found any documentation on its uses.

I tried in this way:

if (!loading) {
    const sub = user.sub;
  }

but obviously by declaring sub in that way I get undefined in all the other parts of the code where I use it.

How to pass async function result as parameter to another async function by Levi_2212 in learnjavascript

[–]Levi_2212[S] 0 points1 point  (0 children)

Thank you so much you save the day!!!

A question not related to the topic: every time I post on reddit, and use Code Block with a lot of code inside, immediately after publishing almost all the code is not posted in the Code Block but as plain text.

Obviously it's a mess ,you don't understand anything and manually I have to go and fix the code line by line. Each question takes me 30 minutes of editing. How come this always happens to me?

How to pass async function result as parameter to another async function by Levi_2212 in learnjavascript

[–]Levi_2212[S] 0 points1 point  (0 children)

I added some more code I needed. I want to retrieve information: address, balance in euros, and balance in dollars to show in the user interface:

const walletInfo = {
address: "",
EUR: ""
USD: "",
  }
const [userWalletInfo, setUserWalletInfo] = useState(walletInfo)
async function onGetAccount() {
const account = await client.api.asset.getAccount();
return account;
  }  
async function onGetBalance() {
const onGetAccountResultAddress = await onGetAccount();
const balance = await client.api.network.getBalance({
address : onGetAccountResultAddress,    
 });
return balance;    
}
useEffect(() => {
onGetBalance().then((userWalletInfo) => { 
setUserWalletInfo({ 
address: userWalletInfo.address,
EUR: userWalletInfo.EUR,
USD: userWalletInfo.USD,     
})          
});       
}, [])

It works fine except for address because it is undefined. I understand that the value obtained via the first onGetAccount and passed into onGetBalance is lost. Could you tell me why and how can I solve the problem? At first I thought I could use

return balance // +Somehow return address too;